Code

Ticket #16593: proxy_model_inheritance_text_fix.v1.diff

File proxy_model_inheritance_text_fix.v1.diff, 1.1 KB (added by jsdalton, 3 years ago)
Line 
1diff --git a/tests/modeltests/proxy_model_inheritance/tests.py b/tests/modeltests/proxy_model_inheritance/tests.py
2index 546c507..813cfd2 100644
3--- a/tests/modeltests/proxy_model_inheritance/tests.py
4+++ b/tests/modeltests/proxy_model_inheritance/tests.py
5@@ -22,15 +22,15 @@ class ProxyModelInheritanceTests(TransactionTestCase):
6         self.old_installed_apps = settings.INSTALLED_APPS
7         settings.INSTALLED_APPS = ('app1', 'app2')
8         map(load_app, settings.INSTALLED_APPS)
9-        call_command('syncdb', verbosity=0)
10-        global ProxyModel, NiceModel
11-        from app1.models import ProxyModel
12-        from app2.models import NiceModel
13 
14     def tearDown(self):
15         settings.INSTALLED_APPS = self.old_installed_apps
16         sys.path = self.old_sys_path
17 
18     def test_table_exists(self):
19+        call_command('syncdb', verbosity=0)
20+        global ProxyModel, NiceModel
21+        from app1.models import ProxyModel
22+        from app2.models import NiceModel
23         self.assertEqual(NiceModel.objects.all().count(), 0)
24         self.assertEqual(ProxyModel.objects.all().count(), 0)