Skip to content

Commit

Permalink
switch to Python 3.11, fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rm03 committed Jan 22, 2024
1 parent 363860d commit 97bc979
Show file tree
Hide file tree
Showing 6 changed files with 265 additions and 123 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-and-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
with:
projectName: pennclubs
path: backend
pythonVersion: 3.12-bookworm
pythonVersion: 3.11-bookworm
flake: true
black: true

Expand Down
3 changes: 2 additions & 1 deletion backend/Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ pandas = "*"
drf-excel = "*"
numpy = "*"
coverage = "*"
daphne = "*"

[requires]
python_version = "3.12"
python_version = "3.11"
367 changes: 254 additions & 113 deletions backend/Pipfile.lock

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions backend/clubs/routing.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@


websocket_urlpatterns = [
path(r"api/ws/chat/<slug:club_code>/", consumers.ChatConsumer),
path(r"api/ws/event/<slug:event_id>/", consumers.LiveEventConsumer),
path(r"api/ws/script/", consumers.ExecuteScriptConsumer),
path(r"api/ws/chat/<slug:club_code>/", consumers.ChatConsumer.as_asgi()),
path(r"api/ws/event/<slug:event_id>/", consumers.LiveEventConsumer.as_asgi()),
path(r"api/ws/script/", consumers.ExecuteScriptConsumer.as_asgi()),
]
2 changes: 1 addition & 1 deletion backend/tests/clubs/test_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ def test_daily_notifications(self):
for usr in [user2, user3, user4]:
Subscribe.objects.create(club=self.club1, person=usr)

now = datetime.datetime(2021, 1, 5, 12, tzinfo=timezone.utc)
now = datetime.datetime(2021, 1, 5, 12, tzinfo=datetime.timezone.utc)

ClubApplication.objects.create(
name="Test Application",
Expand Down
8 changes: 4 additions & 4 deletions backend/tests/clubs/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ def test_event_list(self):
content_type="application/json",
)
self.assertIn(resp.status_code, [200], resp.content)
self.assertEquals(len(resp.data), 3, resp.content)
self.assertEqual(len(resp.data), 3, resp.content)

# list events with a filter
resp = self.client.get(
Expand All @@ -487,7 +487,7 @@ def test_event_list(self):
content_type="application/json",
)
self.assertIn(resp.status_code, [200], resp.content)
self.assertEquals(1, len(resp.data), resp.data)
self.assertEqual(1, len(resp.data), resp.data)

def test_event_update_fair(self):
Membership.objects.create(
Expand Down Expand Up @@ -1395,9 +1395,9 @@ def test_club_archive(self):
# ensure archived was correctly recorded
club = Club.objects.filter(archived=True).first()
self.assertTrue(club is not None)
self.assertEquals(club.code, self.club1.code)
self.assertEqual(club.code, self.club1.code)
self.assertTrue(club.archived)
self.assertEquals(club.archived_by, self.user5)
self.assertEqual(club.archived_by, self.user5)

# ensure club was taken off clubs endpoint
resp = self.client.get(reverse("clubs-list"))
Expand Down

0 comments on commit 97bc979

Please sign in to comment.