mirror of https://github.com/zulip/zulip.git
puppeteer_tests: Use POST for flush_caches call.
This commit is contained in:
parent
99f8be6a12
commit
f5b7e5d934
|
@ -90,7 +90,7 @@ def run_tests(files: Iterable[str], external_host: str) -> None:
|
||||||
# Resetting test environment.
|
# Resetting test environment.
|
||||||
reset_zulip_test_database()
|
reset_zulip_test_database()
|
||||||
# We are calling to /flush_caches to remove all the server-side caches.
|
# We are calling to /flush_caches to remove all the server-side caches.
|
||||||
response = requests.get("http://zulip.zulipdev.com:9981/flush_caches")
|
response = requests.post("http://zulip.zulipdev.com:9981/flush_caches")
|
||||||
assert response.status_code == 200
|
assert response.status_code == 200
|
||||||
|
|
||||||
if ret != 0:
|
if ret != 0:
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from django.http import HttpRequest, HttpResponse
|
from django.http import HttpRequest, HttpResponse
|
||||||
|
from django.views.decorators.csrf import csrf_exempt
|
||||||
|
|
||||||
|
from zerver.decorator import require_post
|
||||||
from zerver.lib.cache import get_cache_backend
|
from zerver.lib.cache import get_cache_backend
|
||||||
from zerver.lib.response import json_success
|
from zerver.lib.response import json_success
|
||||||
from zerver.models import clear_client_cache, flush_per_request_caches
|
from zerver.models import clear_client_cache, flush_per_request_caches
|
||||||
|
@ -9,6 +11,8 @@ from zerver.models import clear_client_cache, flush_per_request_caches
|
||||||
ZULIP_PATH = os.path.join(os.path.dirname(os.path.abspath(__file__)), "../../../")
|
ZULIP_PATH = os.path.join(os.path.dirname(os.path.abspath(__file__)), "../../../")
|
||||||
|
|
||||||
# This is used only by the Puppeteer Tests to clear all the cache after each run.
|
# This is used only by the Puppeteer Tests to clear all the cache after each run.
|
||||||
|
@csrf_exempt
|
||||||
|
@require_post
|
||||||
def remove_caches(request: HttpRequest) -> HttpResponse:
|
def remove_caches(request: HttpRequest) -> HttpResponse:
|
||||||
cache = get_cache_backend(None)
|
cache = get_cache_backend(None)
|
||||||
cache.clear()
|
cache.clear()
|
||||||
|
|
Loading…
Reference in New Issue