mirror of
https://github.com/django/django.git
synced 2025-08-02 18:13:02 +00:00
Fixed #22183: Through M2Ms now correctly handled
This commit is contained in:
parent
cdf6eba181
commit
6b07804474
5 changed files with 44 additions and 3 deletions
|
@ -242,6 +242,12 @@ class FieldDeconstructionTests(TestCase):
|
|||
self.assertEqual(args, [])
|
||||
self.assertEqual(kwargs, {"to": "auth.User"})
|
||||
self.assertEqual(kwargs['to'].setting_name, "AUTH_USER_MODEL")
|
||||
# Test through
|
||||
field = models.ManyToManyField("auth.Permission", through="auth.Group")
|
||||
name, path, args, kwargs = field.deconstruct()
|
||||
self.assertEqual(path, "django.db.models.ManyToManyField")
|
||||
self.assertEqual(args, [])
|
||||
self.assertEqual(kwargs, {"to": "auth.Permission", "through": "auth.Group"})
|
||||
|
||||
@override_settings(AUTH_USER_MODEL="auth.Permission")
|
||||
def test_many_to_many_field_swapped(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue