models: Add clear_client_cache function to clear get_client_cache.

This is a prep commit, this function will be used when we
want to reset the test environment of the puppeteer test.
This commit is contained in:
Riken Shah
2021-03-24 16:34:41 +05:30
committed by Tim Abbott
parent f18d7fa7ed
commit b8691fb252

View File

@@ -1821,6 +1821,11 @@ class Client(models.Model):
get_client_cache: Dict[str, Client] = {}
def clear_client_cache() -> None: # nocoverage
global get_client_cache
get_client_cache = {}
def get_client(name: str) -> Client:
# Accessing KEY_PREFIX through the module is necessary
# because we need the updated value of the variable.