summaryrefslogtreecommitdiff
path: root/tests/field_deconstruction
diff options
context:
space:
mode:
authorAbraham Martin <abraham@firemac.local>2014-07-26 18:48:36 +0200
committerAndrew Godwin <andrew@aeracode.org>2014-07-26 10:00:02 -0700
commite1347e9253821a31f9896de9eb993e2376e7398f (patch)
tree6a49c3b9febe96f6f0dc956fca6c645e76980d3b /tests/field_deconstruction
parent805774df1f2ec9552f1d9c826f5ca9276684da11 (diff)
Fixed #23101 db_table wasn't copied in deconstruct
Forward port of 999758fc7a2d6fcb01eb40de937d4420f884788d from stable/1.7.x
Diffstat (limited to 'tests/field_deconstruction')
-rw-r--r--tests/field_deconstruction/tests.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/field_deconstruction/tests.py b/tests/field_deconstruction/tests.py
index 2f0732a60e..5a424eea3c 100644
--- a/tests/field_deconstruction/tests.py
+++ b/tests/field_deconstruction/tests.py
@@ -271,6 +271,12 @@ class FieldDeconstructionTests(TestCase):
self.assertEqual(path, "django.db.models.ManyToManyField")
self.assertEqual(args, [])
self.assertEqual(kwargs, {"to": "auth.Permission", "through": "auth.Group"})
+ # Test custom db_table
+ field = models.ManyToManyField("auth.Permission", db_table="custom_table")
+ name, path, args, kwargs = field.deconstruct()
+ self.assertEqual(path, "django.db.models.ManyToManyField")
+ self.assertEqual(args, [])
+ self.assertEqual(kwargs, {"to": "auth.Permission", "db_table": "custom_table"})
@override_settings(AUTH_USER_MODEL="auth.Permission")
def test_many_to_many_field_swapped(self):