mirror of
https://github.com/django/django.git
synced 2025-08-04 19:08:28 +00:00
Refs #25415 -- Fixed invalid models in the test suite.
This commit is contained in:
parent
bae64dd0f1
commit
652bcc6f5f
10 changed files with 16 additions and 17 deletions
|
@ -166,7 +166,7 @@ class MexicanRestaurant(Restaurant):
|
|||
|
||||
|
||||
class ClassyMexicanRestaurant(MexicanRestaurant):
|
||||
restaurant = models.OneToOneField(MexicanRestaurant, models.CASCADE, parent_link=True, primary_key=True)
|
||||
the_restaurant = models.OneToOneField(MexicanRestaurant, models.CASCADE, parent_link=True, primary_key=True)
|
||||
tacos_are_yummy = models.BooleanField(default=False)
|
||||
|
||||
|
||||
|
|
|
@ -1461,7 +1461,7 @@ class ModelFormsetTest(TestCase):
|
|||
# a formset for a Model that has a custom primary key that still needs to be
|
||||
# added to the formset automatically
|
||||
FormSet = modelformset_factory(ClassyMexicanRestaurant, fields=["tacos_are_yummy"])
|
||||
self.assertEqual(sorted(FormSet().forms[0].fields.keys()), ['restaurant', 'tacos_are_yummy'])
|
||||
self.assertEqual(sorted(FormSet().forms[0].fields.keys()), ['tacos_are_yummy', 'the_restaurant'])
|
||||
|
||||
def test_model_formset_with_initial_model_instance(self):
|
||||
# has_changed should compare model instance and primary key
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue