diff options
| author | Ramiro Morales <cramm0@gmail.com> | 2013-02-02 21:08:45 -0300 |
|---|---|---|
| committer | Ramiro Morales <cramm0@gmail.com> | 2013-02-02 21:11:32 -0300 |
| commit | 08dc90bccf7c4ffa8b04064d74b54c1150af5ff9 (patch) | |
| tree | 4404e8e0a61a2742bc779773c1ad21703c1a6207 /tests | |
| parent | c9c40bc6bc64e67365338751e4967d86d0882abf (diff) | |
Fixed #14305 -- Switched inspectdb to create unmanaged models.
Thanks Ian Kelly for the report and initial patch.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/regressiontests/inspectdb/tests.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/regressiontests/inspectdb/tests.py b/tests/regressiontests/inspectdb/tests.py index 33fd567546..d77e21bf92 100644 --- a/tests/regressiontests/inspectdb/tests.py +++ b/tests/regressiontests/inspectdb/tests.py @@ -140,3 +140,13 @@ class InspectDBTestCase(TestCase): self.assertIn("field_field_0 = models.IntegerField(db_column='%s__')" % base_name, output) self.assertIn("field_field_1 = models.IntegerField(db_column='__field')", output) self.assertIn("prc_x = models.IntegerField(db_column='prc(%) x')", output) + + def test_managed_models(self): + """Test that by default the command generates models with `Meta.managed = False` (#14305)""" + out = StringIO() + call_command('inspectdb', + table_name_filter=lambda tn:tn.startswith('inspectdb_columntypes'), + stdout=out) + output = out.getvalue() + self.longMessage = False + self.assertIn(" managed = False", output, msg='inspectdb should generate unmanaged models.') |
