diff options
| author | Moayad Mardini <moayad.m@gmail.com> | 2014-05-22 14:29:30 +0300 |
|---|---|---|
| committer | Baptiste Mispelon <bmispelon@gmail.com> | 2014-05-22 16:20:21 +0200 |
| commit | 7d4a51e239bcde34d1614877accb3aa5f5589e0c (patch) | |
| tree | 0cc0048bb03db5ab453ba51a4d7fcd4893f08096 /tests | |
| parent | fb45e666c204d7188c38469ca1f661a9b113b85b (diff) | |
[1.7.x] Fixed #22679 -- Fixed empty tuple serialization in MigrationWriter.
Thanks rockallite.wulf for the report.
Backport of ad994a3c5b5911a12a5e2f2a8d06c036be1b8ad8 from master.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/migrations/test_writer.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/migrations/test_writer.py b/tests/migrations/test_writer.py index 58b5aa6cac..f73f08fb9c 100644 --- a/tests/migrations/test_writer.py +++ b/tests/migrations/test_writer.py @@ -125,6 +125,18 @@ class WriterTests(TestCase): ) ) + def test_serialize_empty_nonempty_tuple(self): + """ + Ticket #22679: makemigrations generates invalid code for (an empty + tuple) default_permissions = () + """ + empty_tuple = () + one_item_tuple = ('a') + many_items_tuple = ('a', 'b', 'c') + self.assertSerializedEqual(empty_tuple) + self.assertSerializedEqual(one_item_tuple) + self.assertSerializedEqual(many_items_tuple) + def test_simple_migration(self): """ Tests serializing a simple migration. |
