summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/test_backend.py10
-rw-r--r--tests/test_backend_memcache.py4
2 files changed, 10 insertions, 4 deletions
diff --git a/tests/test_backend.py b/tests/test_backend.py
index 6768e9c5..a7344067 100644
--- a/tests/test_backend.py
+++ b/tests/test_backend.py
@@ -1949,8 +1949,14 @@ class IdentityTests(object):
class TokenTests(object):
+ def _create_token_id(self):
+ token_id = ""
+ for i in range(1, 20):
+ token_id += uuid.uuid4().hex
+ return token_id
+
def test_token_crud(self):
- token_id = uuid.uuid4().hex
+ token_id = self._create_token_id()
data = {'id': token_id, 'a': 'b',
'trust_id': None,
'user': {'id': 'testuserid'}}
@@ -1974,7 +1980,7 @@ class TokenTests(object):
self.token_api.delete_token, token_id)
def create_token_sample_data(self, tenant_id=None, trust_id=None):
- token_id = uuid.uuid4().hex
+ token_id = self._create_token_id()
data = {'id': token_id, 'a': 'b',
'user': {'id': 'testuserid'}}
if tenant_id is not None:
diff --git a/tests/test_backend_memcache.py b/tests/test_backend_memcache.py
index b7f26b1d..9fbaeb90 100644
--- a/tests/test_backend_memcache.py
+++ b/tests/test_backend_memcache.py
@@ -79,14 +79,14 @@ class MemcacheToken(test.TestCase, test_backend.TokenTests):
self.token_api = token_memcache.Token(client=fake_client)
def test_create_unicode_token_id(self):
- token_id = unicode(uuid.uuid4().hex)
+ token_id = unicode(self._create_token_id())
data = {'id': token_id, 'a': 'b',
'user': {'id': 'testuserid'}}
self.token_api.create_token(token_id, data)
self.token_api.get_token(token_id)
def test_create_unicode_user_id(self):
- token_id = uuid.uuid4().hex
+ token_id = self._create_token_id()
user_id = unicode(uuid.uuid4().hex)
data = {'id': token_id, 'a': 'b',
'user': {'id': user_id}}