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.
This commit is contained in:
parent
17a8933597
commit
e852ac3185
@ -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(
|
||||
|
Loading…
x
Reference in New Issue
Block a user