From e852ac31852f9305c10a426b436effe804537f98 Mon Sep 17 00:00:00 2001 From: GotthardG <51994228+GotthardG@users.noreply.github.com> Date: Fri, 31 Jan 2025 21:52:48 +0100 Subject: [PATCH] Clean up testfunctions.ipynb by removing redundant code Removed outdated and unused code snippets from testfunctions.ipynb to streamline the notebook. This improves readability and reduces clutter, ensuring the file contains only relevant and functional code samples. --- backend/tests/test_contact.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/backend/tests/test_contact.py b/backend/tests/test_contact.py index b8df0a7..1e26ad0 100644 --- a/backend/tests/test_contact.py +++ b/backend/tests/test_contact.py @@ -4,16 +4,18 @@ from backend.main import app client = TestClient(app) -def authenticate(client): +def authenticate(): + # Simulate login to obtain token response = client.post( - "/auth/login", json={"username": "testuser", "password": "testpassword"} + "/auth/login", json={"username": "testuser", "password": "securepassword"} ) assert response.status_code == 200 return response.json()["access_token"] def test_create_contact_success(): - token = authenticate(client) + # Authenticate and attach token to headers + token = authenticate() headers = {"Authorization": f"Bearer {token}"} response = client.post(