Skip to content

Commit

Permalink
fix: tweak query count behavior (not sure if this is safe)
Browse files Browse the repository at this point in the history
  • Loading branch information
ormsbee committed Jul 13, 2024
1 parent 4b5e36e commit 5dbb18a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -529,9 +529,8 @@ def test_get_dates_for_course_query_counts(self, has_schedule, pass_user_object,
course_id=self.course.id, user=user, schedule=schedule
)

# Second time, the request cache eliminates all querying (sometimes)...
# If a schedule is not provided, we will get the schedule to avoid caching outdated dates
with self.assertNumQueries(0 if schedule else 1):
# Second time, the request cache eliminates all querying...
with self.assertNumQueries(0):
cached_dates = api.get_dates_for_course(
course_id=self.course.id, user=user, schedule=schedule
)
Expand Down

0 comments on commit 5dbb18a

Please sign in to comment.