mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
@@ -22,6 +22,8 @@ class ProxyModelInheritanceTests(TransactionTestCase):
|
||||
apps and calls syncdb, then verifies that the table has been created.
|
||||
"""
|
||||
|
||||
available_apps = []
|
||||
|
||||
def setUp(self):
|
||||
self.old_sys_path = sys.path[:]
|
||||
sys.path.append(os.path.dirname(os.path.abspath(upath(__file__))))
|
||||
@@ -38,7 +40,11 @@ class ProxyModelInheritanceTests(TransactionTestCase):
|
||||
del cache.app_models['app2']
|
||||
|
||||
def test_table_exists(self):
|
||||
call_command('syncdb', verbosity=0)
|
||||
try:
|
||||
cache.set_available_apps(settings.INSTALLED_APPS)
|
||||
call_command('syncdb', verbosity=0)
|
||||
finally:
|
||||
cache.unset_available_apps()
|
||||
from .app1.models import ProxyModel
|
||||
from .app2.models import NiceModel
|
||||
self.assertEqual(NiceModel.objects.all().count(), 0)
|
||||
|
||||
Reference in New Issue
Block a user