Skip to content

Commit

Permalink
Fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewelwell committed Jul 30, 2024
1 parent 231bcc3 commit 59b45b1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion api/e2etests/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ def __init__(self, get_response):

def __call__(self, request):
request.is_e2e = False
if request.META.get("E2E_TEST_AUTH_TOKEN") == settings.E2E_TEST_AUTH_TOKEN:
if (
request.META.get("HTTP_X_E2E_TEST_AUTH_TOKEN")
== settings.E2E_TEST_AUTH_TOKEN
):
request.is_e2e = True

return self.get_response(request)
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ def test_e2e_teardown(settings, db) -> None:
token = "test-token"
register_url = "/api/v1/auth/users/"
settings.ENABLE_FE_E2E = True

os.environ["E2E_TEST_AUTH_TOKEN"] = token
settings.E2E_TEST_AUTH_TOKEN = token
settings.MIDDLEWARE.append("e2etests.middleware.E2ETestMiddleware")

client = APIClient(HTTP_X_E2E_TEST_AUTH_TOKEN=token)

Expand Down

0 comments on commit 59b45b1

Please sign in to comment.