Skip to content
Snippets Groups Projects
Commit 1130feb5 authored by Bryan BRANCOTTE's avatar Bryan BRANCOTTE
Browse files

factorize code

parent 8bbb49fd
No related branches found
No related tags found
1 merge request!57Speedup tests
Pipeline #115221 failed
......@@ -66,14 +66,22 @@ def create_dummy_drugbank_compound(id_, smiles):
dbc.save()
def my_install_cache():
backend = requests_cache.SQLiteCache(
os.path.join(settings.PERSISTENT_DIR, "tests_http_cache"),
use_memory=True,
use_temp=True,
)
requests_cache.install_cache(backend=backend)
class TestCaseWithRequestsCache(TestCase):
def setUp(self):
requests_cache.install_cache(os.path.join(settings.PERSISTENT_DIR, "tests_http_cache"), backend="sqlite")
my_install_cache()
class TransactionTestCaseWithRequestsCache(TransactionTestCase):
def setUp(self):
backend = requests_cache.SQLiteCache(os.path.join(settings.PERSISTENT_DIR, "tests_http_cache"), use_memory=True)
requests_cache.install_cache(backend=backend)
my_install_cache()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment