summaryrefslogtreecommitdiff
path: root/tests/inspectdb/tests.py
diff options
context:
space:
mode:
authorDamien Nozay <damien.nozay@gmail.com>2014-07-14 13:42:05 -0700
committerTim Graham <timograham@gmail.com>2014-07-18 16:10:59 +0000
commit70c54a3694975c43a2e0e22c4a90c3cbe1eb54e4 (patch)
treecfe9b7263efe61d95181434c2f4406e479bf49cd /tests/inspectdb/tests.py
parentb8d255071ead897cf68120cd2fae7c91326ca2cc (diff)
downloaddjango-70c54a3694975c43a2e0e22c4a90c3cbe1eb54e4.tar.gz
Fixed #23028: Added unique_togther support to inspectdb.
Diffstat (limited to 'tests/inspectdb/tests.py')
-rw-r--r--tests/inspectdb/tests.py8
1 files changed, 8 insertions, 0 deletions
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):