Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
HungNgien committed Dec 24, 2024
1 parent 032a20d commit 445f34a
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 20 deletions.
18 changes: 9 additions & 9 deletions src/tests/agenda/test_agenda_schedule_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def test_schedule_frab_xml_export(
schedule_schema_xml,
break_slot,
):
with django_assert_max_num_queries(15):
with django_assert_max_num_queries(16):
response = client.get(
reverse(
"agenda:export.schedule.xml",
Expand All @@ -65,7 +65,7 @@ def test_schedule_frab_xml_export(
etree.fromstring(
response.content, parser
) # Will raise if the schedule does not match the schema
with django_assert_max_num_queries(10):
with django_assert_max_num_queries(11):
response = client.get(
reverse(
"agenda:export.schedule.xml",
Expand All @@ -84,7 +84,7 @@ def test_schedule_frab_xml_export_control_char(
slot.submission.description = "control char: \a"
slot.submission.save()

with django_assert_max_num_queries(11):
with django_assert_max_num_queries(12):
response = client.get(
reverse(
"agenda:export.schedule.xml",
Expand Down Expand Up @@ -117,7 +117,7 @@ def test_schedule_frab_json_export(
follow=True,
)
client.force_login(orga_user)
with django_assert_max_num_queries(24):
with django_assert_max_num_queries(25):
orga_response = client.get(
reverse(
"agenda:export.schedule.json",
Expand Down Expand Up @@ -152,7 +152,7 @@ def test_schedule_frab_json_export(
def test_schedule_frab_xcal_export(
slot, client, django_assert_max_num_queries, break_slot
):
with django_assert_max_num_queries(11):
with django_assert_max_num_queries(12):
response = client.get(
reverse(
"agenda:export.schedule.xcal",
Expand All @@ -168,7 +168,7 @@ def test_schedule_frab_xcal_export(

@pytest.mark.django_db
def test_schedule_ical_export(slot, orga_client, django_assert_max_num_queries):
with django_assert_max_num_queries(16):
with django_assert_max_num_queries(17):
response = orga_client.get(
reverse(
"agenda:export.schedule.ics",
Expand Down Expand Up @@ -243,7 +243,7 @@ def test_schedule_speaker_ical_export(

@pytest.mark.django_db
def test_feed_view(slot, client, django_assert_max_num_queries, schedule):
with django_assert_max_num_queries(10):
with django_assert_max_num_queries(11):
response = client.get(slot.submission.event.urls.feed)
assert response.status_code == 200
assert schedule.version in response.content.decode()
Expand Down Expand Up @@ -562,7 +562,7 @@ def test_html_export_full(

@pytest.mark.django_db
def test_speaker_csv_export(slot, orga_client, django_assert_max_num_queries):
with django_assert_max_num_queries(18):
with django_assert_max_num_queries(19):
response = orga_client.get(
reverse(
"agenda:export",
Expand All @@ -576,7 +576,7 @@ def test_speaker_csv_export(slot, orga_client, django_assert_max_num_queries):

@pytest.mark.django_db
def test_empty_speaker_csv_export(orga_client, django_assert_max_num_queries, event):
with django_assert_max_num_queries(13):
with django_assert_max_num_queries(14):
response = orga_client.get(
reverse(
"agenda:export",
Expand Down
4 changes: 2 additions & 2 deletions src/tests/agenda/views/test_agenda_feedback.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
def test_can_create_feedback(django_assert_num_queries, past_slot, client, event):
with scope(event=event):
assert past_slot.submission.speakers.count() == 1
with django_assert_num_queries(42):
with django_assert_num_queries(43):
response = client.post(
past_slot.submission.urls.feedback, {"review": "cool!"}, follow=True
)
Expand All @@ -33,7 +33,7 @@ def test_can_create_feedback_for_multiple_speakers(
past_slot.submission.speakers.add(other_speaker)
past_slot.submission.speakers.add(speaker)
assert past_slot.submission.speakers.count() == 2
with django_assert_num_queries(43):
with django_assert_num_queries(44):
response = client.post(
past_slot.submission.urls.feedback, {"review": "cool!"}, follow=True
)
Expand Down
16 changes: 8 additions & 8 deletions src/tests/agenda/views/test_agenda_talks.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def test_can_see_talk_list(client, django_assert_num_queries, event, slot, other

@pytest.mark.django_db
def test_can_see_talk(client, django_assert_num_queries, event, slot, other_slot):
with django_assert_num_queries(21):
with django_assert_num_queries(22):
response = client.get(slot.submission.urls.public, follow=True)
with scope(event=event):
assert event.schedules.count() == 2
Expand Down Expand Up @@ -73,7 +73,7 @@ def test_can_see_talk_edit_btn(
orga_client, django_assert_num_queries, orga_user, event, slot
):
slot.submission.speakers.add(orga_user)
with django_assert_num_queries(27):
with django_assert_num_queries(30):
response = orga_client.get(slot.submission.urls.public, follow=True)
assert response.status_code == 200
content = response.content.decode()
Expand All @@ -84,7 +84,7 @@ def test_can_see_talk_edit_btn(
def test_can_see_talk_do_not_record(client, django_assert_num_queries, slot):
slot.submission.do_not_record = True
slot.submission.save()
with django_assert_num_queries(20):
with django_assert_num_queries(21):
response = client.get(slot.submission.urls.public, follow=True)
assert response.status_code == 200
content = response.content.decode()
Expand All @@ -99,7 +99,7 @@ def test_can_see_talk_does_accept_feedback(
slot.start = now() - dt.timedelta(days=1)
slot.end = slot.start + dt.timedelta(hours=1)
slot.save()
with django_assert_num_queries(21):
with django_assert_num_queries(22):
response = client.get(slot.submission.urls.public, follow=True)
assert response.status_code == 200
content = response.content.decode()
Expand Down Expand Up @@ -150,7 +150,7 @@ def test_event_talk_visiblity_accepted(
def test_event_talk_visiblity_confirmed(
client, django_assert_num_queries, event, slot, confirmed_submission
):
with django_assert_num_queries(19):
with django_assert_num_queries(20):
response = client.get(confirmed_submission.urls.public, follow=True)
assert response.status_code == 200

Expand Down Expand Up @@ -185,7 +185,7 @@ def test_talk_speaker_other_submissions(
):
with scope(event=event):
other_submission.speakers.add(speaker)
with django_assert_num_queries(21):
with django_assert_num_queries(22):
response = client.get(other_submission.urls.public, follow=True)

assert response.status_code == 200
Expand Down Expand Up @@ -226,7 +226,7 @@ def test_talk_speaker_other_submissions_only_if_visible(
is_visible=False
)

with django_assert_num_queries(21):
with django_assert_num_queries(22):
response = client.get(other_submission.urls.public, follow=True)

assert response.status_code == 200
Expand All @@ -246,7 +246,7 @@ def test_talk_speaker_other_submissions_only_if_visible(
def test_talk_review_page(
client, django_assert_num_queries, event, submission, other_submission
):
with django_assert_num_queries(14):
with django_assert_num_queries(15):
response = client.get(submission.urls.review, follow=True)
assert response.status_code == 200
assert submission.title in response.content.decode()
2 changes: 1 addition & 1 deletion src/tests/agenda/views/test_agenda_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def test_widget_data(
):
event.feature_flags["show_schedule"] = True
event.save()
with django_assert_num_queries(10):
with django_assert_num_queries(14):
response = client.get(
event.urls.schedule + "widgets/schedule.json", follow=True
)
Expand Down

0 comments on commit 445f34a

Please sign in to comment.