'Test that we don\'t load translations for all the translated fields
that live on Addon but we don\'t need in Webapp.'

def test_meta_translated_fields(self):

    useless_fields = ()
    useful_fields = ('homepage', 'privacy_policy', 'name', 'description', 'support_email', 'support_url')
    self.assertSetEqual(Webapp._meta.translated_fields, [Webapp._meta.get_field(f) for f in (useless_fields + useful_fields)])
    self.assertSetEqual(Webapp._meta.translated_fields, [Webapp._meta.get_field(f) for f in useful_fields])
    data = dict(zip((useless_fields + useful_fields), (useless_fields + useful_fields)))
    app = app_factory(**data)
    for field_name in (useless_fields + useful_fields):
        field_id_name = app._meta.get_field(field_name).attname
        ok_(getattr(app, field_name, None))
        ok_(getattr(app, field_id_name, None))
    app = Webapp.objects.get(pk=app.pk)
    for field_name in useless_fields:
        field_id_name = app._meta.get_field(field_name).attname
        ok_((getattr(app, field_name, None) is None))
        ok_(getattr(app, field_id_name, None))
    for field_name in useful_fields:
        field_id_name = app._meta.get_field(field_name).attname
        ok_(getattr(app, field_name, None))
        ok_(getattr(app, field_id_name, None))
