summaryrefslogtreecommitdiff
path: root/tests/proxy_model_inheritance/tests.py
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2013-12-19 22:33:46 +0100
committerAymeric Augustin <aymeric.augustin@m4x.org>2013-12-22 11:39:18 +0100
commit2239081ff16aab1eaafea003433f7139bf13e097 (patch)
tree373ddb3cf271c77d8baf0e4fd22fcc9f0d5f4d92 /tests/proxy_model_inheritance/tests.py
parent9cdf1f6d547b6dffcee26f0a525429452551bb4a (diff)
Expurged INSTALLED_APPS from code and tests.
Except the app cache code and a few specific tests, of course.
Diffstat (limited to 'tests/proxy_model_inheritance/tests.py')
-rw-r--r--tests/proxy_model_inheritance/tests.py18
1 files changed, 8 insertions, 10 deletions
diff --git a/tests/proxy_model_inheritance/tests.py b/tests/proxy_model_inheritance/tests.py
index 01a2ddfef6..91fcbbcc09 100644
--- a/tests/proxy_model_inheritance/tests.py
+++ b/tests/proxy_model_inheritance/tests.py
@@ -13,7 +13,8 @@ from .models import (ConcreteModel, ConcreteModelSubclass,
ConcreteModelSubclassProxy)
-@override_settings(INSTALLED_APPS=('app1', 'app2'))
+# Required for available_apps.
+@override_settings(INSTALLED_APPS=['app1', 'app2'])
class ProxyModelInheritanceTests(TransactionTestCase):
"""
Proxy model inheritance across apps can result in migrate not creating the table
@@ -25,20 +26,17 @@ class ProxyModelInheritanceTests(TransactionTestCase):
def setUp(self):
self.old_sys_path = sys.path[:]
sys.path.append(os.path.dirname(os.path.abspath(upath(__file__))))
- self._with_app1 = app_cache._begin_with_app('app1')
- self._with_app2 = app_cache._begin_with_app('app2')
def tearDown(self):
- app_cache._end_with_app(self._with_app1)
- app_cache._end_with_app(self._with_app2)
sys.path = self.old_sys_path
def test_table_exists(self):
- call_command('migrate', verbosity=0)
- from .app1.models import ProxyModel
- from .app2.models import NiceModel
- self.assertEqual(NiceModel.objects.all().count(), 0)
- self.assertEqual(ProxyModel.objects.all().count(), 0)
+ with app_cache._with_app('app1'), app_cache._with_app('app2'):
+ call_command('migrate', verbosity=0)
+ from .app1.models import ProxyModel
+ from .app2.models import NiceModel
+ self.assertEqual(NiceModel.objects.all().count(), 0)
+ self.assertEqual(ProxyModel.objects.all().count(), 0)
class MultiTableInheritanceProxyTest(TestCase):