Skip to content

Commit

Permalink
➕ Add test for input sanitization
Browse files Browse the repository at this point in the history
  • Loading branch information
devmount committed Apr 9, 2024
1 parent ea6162f commit 7e42ad4
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions backend/test/integration/test_schedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,23 @@ def test_update_existing_schedule(self, with_client, make_schedule):
assert weekdays == [2, 4, 6]
assert data["slot_duration"] == 60

def test_update_existing_schedule_with_html(self, with_client, make_schedule):
generated_schedule = make_schedule()

response = with_client.put(
f"/schedule/{generated_schedule.id}",
json={
"calendar_id": generated_schedule.calendar_id,
"name": "<i>Schedule</i>",
"details": "Lorem <p>test</p> Ipsum<br><script>run_evil();</script>",
},
headers=auth_headers,
)
assert response.status_code == 200, response.text
data = response.json()
assert data["name"] == "Schedule"
assert data["details"] == "Lorem test Ipsum"

def test_update_missing_schedule(self, with_client, make_schedule):
generated_schedule = make_schedule()

Expand Down

0 comments on commit 7e42ad4

Please sign in to comment.