コード例 #1
0
    def test_create_fields_inline(self):
        with LanguageOverride("en"):
            # Fixtures (should eventually be shared with other tests)

            translate_mixin = TranslatableModelAdminMixin()
            formset = translatable_inlineformset_factory(translate_mixin._language(self.request),
                                                         Normal, Related)(#self.request.POST,
                                                                          instance=self.object)

            self.assertTrue(formset.forms[0].fields.has_key("normal"))
            self.assertTrue(formset.forms[0].fields.has_key("translated"))
            self.assertTrue(formset.forms[0].fields.has_key("translated_to_translated"))
            self.assertFalse(formset.forms[0].fields.has_key("language_code"))
コード例 #2
0
    def test_create_fields_inline(self):
        with LanguageOverride("en"):
            # Fixtures (should eventually be shared with other tests)

            translate_mixin = TranslatableModelAdminMixin()
            formset = translatable_inlineformset_factory(
                translate_mixin._language(self.request), Normal,
                Related)(  #self.request.POST,
                    instance=self.object)

            self.assertTrue(formset.forms[0].fields.has_key("normal"))
            self.assertTrue(formset.forms[0].fields.has_key("translated"))
            self.assertTrue(
                formset.forms[0].fields.has_key("translated_to_translated"))
            self.assertFalse(formset.forms[0].fields.has_key("language_code"))