diff options
| author | Florian Apolloner <apollo13@users.noreply.github.com> | 2017-05-10 15:47:20 +0200 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2017-05-10 09:52:26 -0400 |
| commit | cf81add99745f230f858652b7546da779fc39cd2 (patch) | |
| tree | dde388961e5f492eaf4211de133520d840516272 /tests/admin_scripts | |
| parent | 03d0c05fdfd3de5f36bf54470ed03018295497c7 (diff) | |
[1.11.x] Fixed db backend discovery in admin_scripts tests.
Not all backends have dots in them.
Backport of 60f51290766dae16abfb60459940de51fa5c5b2f from master
Diffstat (limited to 'tests/admin_scripts')
| -rw-r--r-- | tests/admin_scripts/tests.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/tests/admin_scripts/tests.py b/tests/admin_scripts/tests.py index af3ada5bcc..d647c821aa 100644 --- a/tests/admin_scripts/tests.py +++ b/tests/admin_scripts/tests.py @@ -120,11 +120,10 @@ class AdminScriptTestCase(unittest.TestCase): Returns the paths for any external backend packages. """ paths = [] - first_package_re = re.compile(r'(^[^\.]+)\.') for backend in settings.DATABASES.values(): - result = first_package_re.findall(backend['ENGINE']) - if result and result != ['django']: - backend_pkg = __import__(result[0]) + package = backend['ENGINE'].split('.')[0] + if package != 'django': + backend_pkg = __import__(package) backend_dir = os.path.dirname(backend_pkg.__file__) paths.append(os.path.dirname(backend_dir)) return paths |
