Skip to content

Commit 1491757

Browse files
committed
chore: apply code review
1 parent 7f6a51d commit 1491757

File tree

4 files changed

+3
-18
lines changed

4 files changed

+3
-18
lines changed

docker-compose.yml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,6 @@
11
version: "3.9"
22

33
services:
4-
# postgres:
5-
# image: postgres:10-bullseye
6-
# ports:
7-
# - "5433:5432"
8-
# environment:
9-
# POSTGRES_USER: pythondotorg
10-
# POSTGRES_PASSWORD: pythondotorg
11-
# POSTGRES_DB: pythondotorg
12-
# POSTGRES_HOST_AUTH_METHOD: trust # never do this in production!
13-
# healthcheck:
14-
# test: ["CMD", "pg_isready", "-U", "pythondotorg", "-d", "pythondotorg"]
15-
# interval: 1s
16-
174
postgres:
185
image: postgres:12-bullseye # required for 4.2 upgrades
196
ports:

events/tests/test_importer.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
from django.test import TestCase
44
from django.utils.timezone import datetime, make_aware
5-
from django.utils.html import strip_tags
65

76
from events.importer import ICSImporter
87
from events.models import Calendar, Event

users/tests/test_forms.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,8 @@ def test_duplicate_username(self):
5050
self.assertIn('username', form.errors)
5151

5252
def test_duplicate_email(self):
53-
from django.http import HttpRequest
5453
User.objects.create_user('test1', '[email protected]', 'testpass')
55-
request = HttpRequest()
54+
request = RequestFactory().get('/')
5655

5756
form = SignupForm(data={
5857
'username': 'username2',

users/tests/test_views.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from django.conf import settings
33
from django.contrib.auth import get_user_model
44
from django.urls import reverse
5-
from django.test import TestCase
5+
from django.test import TestCase, override_settings
66

77
from sponsors.forms import SponsorUpdateForm, SponsorRequiredAssetsForm
88
from sponsors.models import Sponsorship, RequiredTextAssetConfiguration, SponsorBenefit
@@ -228,8 +228,8 @@ def test_user_new_account(self):
228228
'password2': 'password',
229229
})
230230

231+
@override_settings(ACCOUNT_PREVENT_ENUMERATION=False)
231232
def test_user_duplicate_username_email(self):
232-
settings.ACCOUNT_PREVENT_ENUMERATION = False
233233
post_data = {
234234
'username': 'thisusernamedoesntexist',
235235
'email': '[email protected]',

0 commit comments

Comments
 (0)