From 70c54a3694975c43a2e0e22c4a90c3cbe1eb54e4 Mon Sep 17 00:00:00 2001 From: Damien Nozay Date: Mon, 14 Jul 2014 13:42:05 -0700 Subject: Fixed #23028: Added unique_togther support to inspectdb. --- tests/inspectdb/tests.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests/inspectdb/tests.py') diff --git a/tests/inspectdb/tests.py b/tests/inspectdb/tests.py index 2fa4e25453..fb72b3756f 100644 --- a/tests/inspectdb/tests.py +++ b/tests/inspectdb/tests.py @@ -217,6 +217,14 @@ class InspectDBTestCase(TestCase): self.longMessage = False self.assertIn(" managed = False", output, msg='inspectdb should generate unmanaged models.') + def test_unique_together_meta(self): + out = StringIO() + call_command('inspectdb', + table_name_filter=lambda tn: tn.startswith('inspectdb_uniquetogether'), + stdout=out) + output = out.getvalue() + self.assertIn(" unique_together = (('field1', 'field2'),)", output, msg='inspectdb should generate unique_together.') + @skipUnless(connection.vendor == 'sqlite', "Only patched sqlite's DatabaseIntrospection.data_types_reverse for this test") def test_custom_fields(self): -- cgit v1.2.1