summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJon Dufresne <jon.dufresne@gmail.com>2016-10-18 17:47:29 -0700
committerJon Dufresne <jon.dufresne@gmail.com>2016-10-25 17:32:59 -0700
commitf3ea0c4bbd5fa9bac73049839ce5de388d53371a (patch)
tree8a1512285c6965622652f973f719a8a2ca20d8b6 /tests
parentb3bd3aa07c026239dd39d1a37498dfd0a2f09caf (diff)
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.
Diffstat (limited to 'tests')
-rw-r--r--tests/auth_tests/test_apps.py62
1 files changed, 0 insertions, 62 deletions
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)