kfet.tests -- More isolated tests for kfet.open

This commit is contained in:
Aurélien Delobelle 2019-01-06 13:48:32 +01:00
parent 7ca0144004
commit 5d14fef032

View file

@ -1,5 +1,5 @@
import json
import threading
import random
from datetime import timedelta
from unittest import mock
@ -18,7 +18,7 @@ class OpenKfetTest(ChannelTestCase):
def setUp(self):
self.kfet_open = OpenKfet(
cache_prefix="test_kfetopen_%s" % threading.get_ident()
cache_prefix="test_kfetopen_%s" % random.randrange(2 ** 20)
)
self.addCleanup(self.kfet_open.clear_cache)
@ -138,7 +138,7 @@ class OpenKfetViewsTest(ChannelTestCase):
self.c_a.login(username="admin", password="admin")
self.kfet_open = OpenKfet(
cache_prefix="test_kfetopen_%s" % threading.get_ident()
cache_prefix="test_kfetopen_%s" % random.randrange(2 ** 20)
)
self.addCleanup(self.kfet_open.clear_cache)
@ -244,7 +244,7 @@ class OpenKfetScenarioTest(ChannelTestCase):
self.r_c_ws.force_login(self.r)
self.kfet_open = OpenKfet(
cache_prefix="test_kfetopen_%s" % threading.get_ident()
cache_prefix="test_kfetopen_%s" % random.randrange(2 ** 20)
)
self.addCleanup(self.kfet_open.clear_cache)