aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2013-09-17 07:05:34 -0700
committerMichał Górny <mgorny@gentoo.org>2013-09-17 07:05:34 -0700
commit5d8f08e759a43b97428b6237be1f34dfb57ca237 (patch)
tree290fee3c156a63972347ed971d0f3169e4001e2a
parentMerge pull request #93 from dastergon/docs (diff)
parentRequire the database cleanup only to remove USER and PASSWORD. (diff)
downloadidentity.gentoo.org-5d8f08e759a43b97428b6237be1f34dfb57ca237.tar.gz
identity.gentoo.org-5d8f08e759a43b97428b6237be1f34dfb57ca237.tar.bz2
identity.gentoo.org-5d8f08e759a43b97428b6237be1f34dfb57ca237.zip
Merge pull request #94 from mgorny/tests-fix
Require the database cleanup only to remove USER and PASSWORD.
-rw-r--r--okupy/tests/unit/test_ldapuser.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/okupy/tests/unit/test_ldapuser.py b/okupy/tests/unit/test_ldapuser.py
index 85097aa..7dd2b5f 100644
--- a/okupy/tests/unit/test_ldapuser.py
+++ b/okupy/tests/unit/test_ldapuser.py
@@ -95,7 +95,8 @@ class LDAPUserUnitTests(TestCase):
self.assertRaises(ldap.INVALID_CREDENTIALS, get_bound_ldapuser,
request, 'test')
db_alias = 'ldap_%s' % request.session.cache_key
- self.assertNotIn(db_alias, settings.DATABASES)
+ self.assertNotIn('USER', settings.DATABASES.get(db_alias, {}))
+ self.assertNotIn('PASSWORD', settings.DATABASES.get(db_alias, {}))
def test_get_bound_ldapuser_context_manager_cleans_up_settings(self):
secondary_password = Random.get_random_bytes(48)
@@ -109,4 +110,5 @@ class LDAPUserUnitTests(TestCase):
with get_bound_ldapuser(request) as user: # noqa
pass
db_alias = 'ldap_%s' % request.session.cache_key
- self.assertNotIn(db_alias, settings.DATABASES)
+ self.assertNotIn('USER', settings.DATABASES.get(db_alias, {}))
+ self.assertNotIn('PASSWORD', settings.DATABASES.get(db_alias, {}))