Skip to content

Commit

Permalink
chore: Add test for ModelWithConstraint expected fields
Browse files Browse the repository at this point in the history
  • Loading branch information
last-partizan committed Feb 9, 2025
1 parent 78588fa commit 02d7ffd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion modeltranslation/tests/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@


@admin.register(models.ModelWithConstraint)
class UniqueNullableModelAdmin(TranslationAdmin):
class ModelWithConstraintAdmin(TranslationAdmin):
pass
9 changes: 9 additions & 0 deletions modeltranslation/tests/test_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,15 @@ class TestModelAdmin(admin.TranslationAdmin):
"dynamic_default_en",
)

def test_model_with_constraint_fields(self):
ma = admin.TranslationAdmin(models.ModelWithConstraint, self.site)

assert tuple(ma.get_form(self.request).base_fields.keys()) == (
"title",
"sub_title_de",
"sub_title_en",
)

def test_default_fieldsets(self):
class TestModelAdmin(admin.TranslationAdmin):
pass
Expand Down

0 comments on commit 02d7ffd

Please sign in to comment.