From f3ea0c4bbd5fa9bac73049839ce5de388d53371a Mon Sep 17 00:00:00 2001 From: Jon Dufresne Date: Tue, 18 Oct 2016 17:47:29 -0700 Subject: Reverted "Fixed #26401 -- Added BaseAuthConfig to use auth without migrations." This reverts commit 1ec1633cb294d8ce2a65ece6b56c258483596fba as it doesn't handle ContentType's auth.Permission dependency. Thus, it doesn't allow auth without migrations. --- tests/auth_tests/test_apps.py | 62 ------------------------------------------- 1 file changed, 62 deletions(-) delete mode 100644 tests/auth_tests/test_apps.py (limited to 'tests') diff --git a/tests/auth_tests/test_apps.py b/tests/auth_tests/test_apps.py deleted file mode 100644 index cc907b8913..0000000000 --- a/tests/auth_tests/test_apps.py +++ /dev/null @@ -1,62 +0,0 @@ -import os -import shutil -import subprocess -import sys -import tempfile -import unittest - -from django.db import ConnectionHandler - - -SETTINGS = """ -SECRET_KEY = 'django_auth_tests_secret_key' - -INSTALLED_APPS = [ - 'django.contrib.auth.apps.BaseAuthConfig', - 'django.contrib.contenttypes', -] - -MIGRATION_MODULES = {'auth': None} - -DATABASES = %(databases)r -""" - - -class AppConfigTests(unittest.TestCase): - def test_no_migrations(self): - project_path = tempfile.mkdtemp() - try: - databases = { - 'default': { - 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': os.path.join(project_path, 'db.sqlite3'), - } - } - - with open(os.path.join(project_path, 'no_migrations.py'), 'w') as fp: - fp.write(SETTINGS % {'databases': databases}) - - with open(os.devnull, 'wb') as devnull: - cmd = [ - sys.executable, - '-m', 'django', - 'migrate', - '--settings', 'no_migrations', - '--pythonpath', project_path, - ] - returncode = subprocess.call(cmd, stdout=devnull, stderr=devnull) - - # Migrate command ran without errors. - self.assertEqual(returncode, 0) - - # Auth tables weren't created. - conns = ConnectionHandler(databases) - try: - self.assertEqual( - set(conns['default'].introspection.table_names()), - {'django_content_type', 'django_migrations'}, - ) - finally: - conns.close_all() - finally: - shutil.rmtree(project_path) -- cgit v1.3