Skip to content

Commit 592208a

Browse files
authored
A series of fixes in stage (#635)
* Update existing prod images * Fix up env-vars and secrets * Fix stage image, permissions * Remove bastion * Add prod cluster with no live services * Variablize Sentry tracing, defaulting to no tracing * Update docker-compose to watch for local changes; update readme * Run a 'ruff format' * Roll back staged prod changes * Add Flower web interface docs to readme * Update existing prod images * Fix up env-vars and secrets * Variablize Sentry tracing, defaulting to no tracing * Roll back staged prod changes * Quote those numbers * Alphabetize; ensure correct tracing settings
1 parent ecdbdfc commit 592208a

File tree

19 files changed

+530
-51
lines changed

19 files changed

+530
-51
lines changed

.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ PADDLE_API_KEY=
6666

6767
SENTRY_DSN=
6868
SENTRY_PROFILE_SAMPLE_RATE=0.0
69+
SENTRY_TRACES_SAMPLE_RATE=0.0
6970

7071
# Celery
7172
CELERY_BROKER=redis://redis:6379

README.md

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,8 @@ During development it's great to have these handy!
3838

3939
## Before you begin
4040

41-
Make sure you have [uv](https://github.com/astral-sh/uv) up and running, and you adjust your hosts file to include:
41+
Make sure you have [uv](https://github.com/astral-sh/uv) up and running.
4242

43-
```
44-
127.0.0.1 keycloak
45-
127.0.0.1 stalwart
46-
```
4743

4844
## Getting Started
4945

@@ -203,3 +199,28 @@ docker compose exec backend uv run manage.py test thunderbird_accounts.client.te
203199
## Running the E2E tests
204200

205201
Please see the [E2E tests README](./test/e2e/README.md).
202+
203+
204+
## Accessing the Flower Web Interface
205+
206+
We run Flower to surface information about Celery tasks. This service exposes a web interface on
207+
port 5555. In development, you can access this at `http://localhost:5555` after bringing services
208+
online with `docker-compose`. In Thunderbird's live (protected) environments, we have to create an
209+
SSH proxy through a bastion.
210+
211+
How to build a bastion is documented in the Pulumi config files themselves. Once you have one that
212+
allows traffic from your IP, you'll need to gather some info:
213+
214+
- Your bastion's public IP address (`$BASTION_IP`)
215+
- The DNS address for the Flower load balancer in the environment (`$FLOWER_LB_DBS`)
216+
- An available local port to forward through, let's say `8443`.
217+
218+
Open an SSH proxy to the bastion server:
219+
220+
```bash
221+
ssh -L 8443:$FLOWER_LB_DNS:443 ec2-user@$BASTION_IP
222+
```
223+
224+
Our live environments all use TLS, so you will need to browse to https://localhost:8443/. You will
225+
have to push past an SSL certificate hostname mismatch alert, but then you will find yourself at the
226+
Flower landing page, listing Celery workers on the network.

docker-compose.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,20 @@ services:
6060
depends_on:
6161
- postgres
6262
- redis
63+
develop:
64+
watch:
65+
- action: rebuild
66+
path: .env
67+
- action: rebuild
68+
path: .env.test
69+
- action: rebuild
70+
path: ./src
71+
- action: rebuild
72+
path: ./assets
73+
- action: rebuild
74+
path: ./keycloak
75+
- action: rebuild
76+
path: ./templates
6377

6478
celery:
6579
<<: *accounts

pulumi/config.prod.yaml

Lines changed: 415 additions & 2 deletions
Large diffs are not rendered by default.

pulumi/config.stage.yaml

Lines changed: 40 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
### Special variables used throughout this file
44

55
# Update this value to update all containers based on this thunderbird/accounts image
6-
.accounts_image: &ACCOUNTS_IMAGE 768512802988.dkr.ecr.eu-central-1.amazonaws.com/thunderbird/accounts:378ccb8058f181e609ca79060f45adceb2affef4
6+
.accounts_image: &ACCOUNTS_IMAGE 768512802988.dkr.ecr.eu-central-1.amazonaws.com/thunderbird/accounts:0ca8bc25c05a3e87012db11d5141e03cc7f8da7b
77

88
# Update this value to update all containers based on this Keycloak image
9-
.keycloak_image: &KEYCLOAK_IMAGE 768512802988.dkr.ecr.eu-central-1.amazonaws.com/thunderbird/accounts:keycloak-e14d46467c921269a4a68dcc4affaaca8c921477
9+
.keycloak_image: &KEYCLOAK_IMAGE 768512802988.dkr.ecr.eu-central-1.amazonaws.com/thunderbird/accounts:keycloak-ecdbdfc1c9ad2394836dff14bfb26f1589005623
1010

1111
# These variables are common to Accounts application environments. Some tasks will require additional configuration.
1212
.admin_contact: &VAR_ADMIN_CONTACT {name: "ADMIN_CONTACT", value: "dummy@example.org"}
@@ -24,25 +24,26 @@
2424
.imap_host: &VAR_IMAP_HOST {name: "IMAP_HOST", value: "mail.stage-thundermail.com"}
2525
.imap_port: &VAR_IMAP_PORT {name: "IMAP_PORT", value: "993"}
2626
.imap_tls: &VAR_IMAP_TLS {name: "IMAP_TLS", value: "True"}
27-
.log_level: &VAR_LOG_LEVEL {name: "LOG_LEVEL", "value": "DEBUG"}
28-
.keycloak_url_api: &VAR_KEYCLOAK_URL_API {name: "KEYCLOAK_URL_API", value: "https://auth-stage.tb.pro/admin/realms/tbpro/"}
29-
.keycloak_admin_url_token: &VAR_KEYCLOAK_ADMIN_URL_TOKEN {name: "KEYCLOAK_ADMIN_URL_TOKEN", value: "https://auth-stage.tb.pro/realms/master/protocol/openid-connect/token/"}
3027
.jmap_host: &VAR_JMAP_HOST {name: "JMAP_HOST", value: "mail.stage-thundermail.com"}
3128
.jmap_port: &VAR_JMAP_PORT {name: "JMAP_PORT", value: "443"}
3229
.jmap_tls: &VAR_JMAP_TLS {name: "JMAP_TLS", value: "True"}
30+
.keycloak_admin_url_token: &VAR_KEYCLOAK_ADMIN_URL_TOKEN {name: "KEYCLOAK_ADMIN_URL_TOKEN", value: "https://auth-stage.tb.pro/realms/master/protocol/openid-connect/token/"}
31+
.keycloak_url_api: &VAR_KEYCLOAK_URL_API {name: "KEYCLOAK_URL_API", value: "https://auth-stage.tb.pro/admin/realms/tbpro/"}
32+
.log_level: &VAR_LOG_LEVEL {name: "LOG_LEVEL", "value": "DEBUG"}
3333
.min_custom_domain_alias_length: &VAR_MIN_CUSTOM_DOMAIN_ALIAS_LENGTH {name: "MIN_CUSTOM_DOMAIN_ALIAS_LENGTH", value: "3"}
3434
.oidc_url_auth: &VAR_OIDC_URL_AUTH {name: "OIDC_URL_AUTH", value: "https://auth-stage.tb.pro/realms/tbpro/protocol/openid-connect/auth"}
35-
.oidc_url_token: &VAR_OIDC_URL_TOKEN {name: "OIDC_URL_TOKEN", value: "https://auth-stage.tb.pro/realms/tbpro/protocol/openid-connect/token"}
36-
.oidc_url_user: &VAR_OIDC_URL_USER {name: "OIDC_URL_USER", value: "https://auth-stage.tb.pro/realms/tbpro/protocol/openid-connect/userinfo"}
3735
.oidc_url_jwks: &VAR_OIDC_URL_JWKS {name: "OIDC_URL_JWKS", value: "https://auth-stage.tb.pro/realms/tbpro/protocol/openid-connect/certs"}
3836
.oidc_url_logout: &VAR_OIDC_URL_LOGOUT {name: "OIDC_URL_LOGOUT", value: "https://auth-stage.tb.pro/realms/tbpro/protocol/openid-connect/logout"}
39-
.paddle_env: &VAR_PADDLE_ENV {name: "PADDLE_ENV", value: "sandbox"}
37+
.oidc_url_token: &VAR_OIDC_URL_TOKEN {name: "OIDC_URL_TOKEN", value: "https://auth-stage.tb.pro/realms/tbpro/protocol/openid-connect/token"}
38+
.oidc_url_user: &VAR_OIDC_URL_USER {name: "OIDC_URL_USER", value: "https://auth-stage.tb.pro/realms/tbpro/protocol/openid-connect/userinfo"}
4039
.public_base_url: &VAR_PUBLIC_BASE_URL {name: "PUBLIC_BASE_URL", value: "https://accounts-stage.tb.pro"}
40+
.paddle_env: &VAR_PADDLE_ENV {name: "PADDLE_ENV", value: "sandbox"}
4141
.redis_celery_db: &VAR_REDIS_CELERY_DB {name: "REDIS_CELERY_DB", value: "5"}
4242
.redis_celery_results_db: &VAR_REDIS_CELERY_RESULTS_DB {name: "REDIS_CELERY_RESULTS_DB", value: "6"}
4343
.redis_internal_db: &VAR_REDIS_INTERNAL_DB {name: "REDIS_INTERNAL_DB", value: "0"}
4444
.redis_shared_db: &VAR_REDIS_SHARED_DB {name: "REDIS_SHARED_DB", value: "10"}
45-
.sentry_profile_sample_rate: &VAR_SENTRY_PROFILE_SAMPLE_RATE {name: "SENTRY_PROFILE_SAMPLE_RATE", "value": 0.33}
45+
.sentry_profile_sample_rate: &VAR_SENTRY_PROFILE_SAMPLE_RATE {name: "SENTRY_PROFILE_SAMPLE_RATE", "value": "0.33"}
46+
.sentry_traces_sample_rate: &VAR_SENTRY_TRACES_SAMPLE_RATE {name: "SENTRY_TRACES_SAMPLE_RATE", value: "1.0"}
4647
.smtp_host: &VAR_SMTP_HOST {name: "SMTP_HOST", value: "mail.stage-thundermail.com"}
4748
.smtp_port: &VAR_SMTP_PORT {name: "SMTP_PORT", value: "465"}
4849
.smtp_tls: &VAR_SMTP_TLS {name: "SMTP_TLS", value: "True"}
@@ -54,12 +55,13 @@
5455
.tb_pro_wait_list_url: &VAR_TB_PRO_WAIT_LIST_URL {name: "TB_PRO_WAIT_LIST_URL", value: "https://tb.pro/waitlist/"}
5556
.use_allow_list: &VAR_USE_ALLOW_LIST {name: "USE_ALLOW_LIST", value: "True"}
5657
.verify_private_link_ssl: &VAR_VERIFY_PRIVATE_LINK_SSL {name: "VERIFY_PRIVATE_LINK_SSL", value: "False"}
57-
.zendesk_form_id: &VAR_ZENDESK_FORM_ID {name: "ZENDESK_FORM_ID", value: "46642378723859"}
5858
.zendesk_form_browser_field_id: &VAR_ZENDESK_FORM_BROWSER_FIELD_ID {name: "ZENDESK_FORM_BROWSER_FIELD_ID", value: "46642389601427"}
59+
.zendesk_form_id: &VAR_ZENDESK_FORM_ID {name: "ZENDESK_FORM_ID", value: "46642378723859"}
5960
.zendesk_form_os_field_id: &VAR_ZENDESK_FORM_OS_FIELD_ID {name: "ZENDESK_FORM_OS_FIELD_ID", value: "46642417675539"}
6061

6162
# These variables are also common to our environments, but are pulled from secret stores instead
6263
.auth_allow_list: &SECRET_AUTH_ALLOW_LIST {name: "AUTH_ALLOW_LIST", valueFrom: "arn:aws:secretsmanager:eu-central-1:768512802988:secret:accounts/stage/fxa-allow-list-Rjs24C"}
64+
.database_host: &SECRET_DATABASE_HOST {name: "DATABASE_HOST", valueFrom: "arn:aws:secretsmanager:eu-central-1:768512802988:secret:accounts/stage/database-host-zmv0GO"}
6365
.database_name: &SECRET_DATABASE_NAME {name: "DATABASE_NAME", valueFrom: "arn:aws:secretsmanager:eu-central-1:768512802988:secret:accounts/stage/database-name-ZCR7dN"}
6466
.database_password: &SECRET_DATABASE_PASSWORD {name: "DATABASE_PASSWORD", valueFrom: "arn:aws:secretsmanager:eu-central-1:768512802988:secret:accounts/stage/database-password-8RraYV"}
6567
.database_user: &SECRET_DATABASE_USER {name: "DATABASE_USER", valueFrom: "arn:aws:secretsmanager:eu-central-1:768512802988:secret:accounts/stage/database-user-a99f03"}
@@ -72,10 +74,12 @@
7274
.oidc_client_id: &SECRET_OIDC_CLIENT_ID {name: "OIDC_CLIENT_ID", valueFrom: "arn:aws:secretsmanager:eu-central-1:768512802988:secret:accounts/stage/oidc-client-id-UzCPWF"}
7375
.oidc_client_secret: &SECRET_OIDC_CLIENT_SECRET {name: "OIDC_CLIENT_SECRET", valueFrom: "arn:aws:secretsmanager:eu-central-1:768512802988:secret:accounts/stage/oidc-client-secret-RzOIiH"}
7476
.oidc_sign_algo: &SECRET_OIDC_SIGN_ALGO {name: "OIDC_SIGN_ALGO", valueFrom: "arn:aws:secretsmanager:eu-central-1:768512802988:secret:accounts/stage/oidc-sign-algo-nEhTVJ"}
77+
.paddle_api_key: &SECRET_PADDLE_API_KEY {Name: "PADDLE_API_KEY", valueFrom: "arn:aws:secretsmanager:eu-central-1:768512802988:secret:accounts/stage/paddle-api-key-WlhcMj"}
7578
.paddle_price_id_lo: &SECRET_PADDLE_PRICE_ID_LO {name: "PADDLE_PRICE_ID_LO", valueFrom: "arn:aws:secretsmanager:eu-central-1:768512802988:secret:accounts/stage/paddle-price-id-lo-BOxRwS"}
7679
.paddle_price_id_md: &SECRET_PADDLE_PRICE_ID_MD {name: "PADDLE_PRICE_ID_MD", valueFrom: "arn:aws:secretsmanager:eu-central-1:768512802988:secret:accounts/stage/paddle-price-id-md-YShIxp"}
7780
.paddle_price_id_hi: &SECRET_PADDLE_PRICE_ID_HI {name: "PADDLE_PRICE_ID_HI", valueFrom: "arn:aws:secretsmanager:eu-central-1:768512802988:secret:accounts/stage/paddle-price-id-hi-8muS08"}
7881
.paddle_token: &SECRET_PADDLE_TOKEN {name: "PADDLE_TOKEN", valueFrom: "arn:aws:secretsmanager:eu-central-1:768512802988:secret:accounts/stage/paddle-token-1Xo0np"}
82+
.paddle_webhook_key: &SECRET_PADDLE_WEBHOOK_KEY {name: "PADDLE_WEBHOOK_KEY", valueFrom: "arn:aws:secretsmanager:eu-central-1:768512802988:secret:accounts/stage/paddle-webhook-key-JuvcOr"}
7983
.redis_url: &SECRET_REDIS_URL {name: "REDIS_URL", valueFrom: "arn:aws:secretsmanager:eu-central-1:768512802988:secret:accounts/stage/redis-url-5zg81L"}
8084
.secret_key: &SECRET_SECRET_KEY {name: "SECRET_KEY", valueFrom: "arn:aws:secretsmanager:eu-central-1:768512802988:secret:accounts/stage/secret-key-RMUzrl"}
8185
.sentry_dsn: &SECRET_SENTRY_DSN {name: "SENTRY_DSN", valueFrom: "arn:aws:secretsmanager:eu-central-1:768512802988:secret:accounts/stage/sentry-dsn-rgui8C"}
@@ -99,7 +103,7 @@
99103
# This forms the base of Accounts-based container definitions. The blank fields commented here must be set on any
100104
# inheriting container definition:
101105
# environment:
102-
# logConfiguration
106+
# logConfiguration:
103107
.accounts_contdef: &ACCOUNTS_CONTAINER_DEFINITION
104108
image: *ACCOUNTS_IMAGE
105109
essential: true
@@ -111,6 +115,7 @@
111115
restartAttemptPeriod: 300
112116
secrets:
113117
- *SECRET_AUTH_ALLOW_LIST
118+
- *SECRET_DATABASE_HOST
114119
- *SECRET_DATABASE_NAME
115120
- *SECRET_DATABASE_PASSWORD
116121
- *SECRET_DATABASE_USER
@@ -123,10 +128,12 @@
123128
- *SECRET_OIDC_CLIENT_ID
124129
- *SECRET_OIDC_CLIENT_SECRET
125130
- *SECRET_OIDC_SIGN_ALGO
131+
- *SECRET_PADDLE_API_KEY
126132
- *SECRET_PADDLE_PRICE_ID_LO
127133
- *SECRET_PADDLE_PRICE_ID_MD
128134
- *SECRET_PADDLE_PRICE_ID_HI
129135
- *SECRET_PADDLE_TOKEN
136+
- *SECRET_PADDLE_WEBHOOK_KEY
130137
- *SECRET_REDIS_URL
131138
- *SECRET_SECRET_KEY
132139
- *SECRET_SENTRY_DSN
@@ -351,23 +358,26 @@ resources:
351358
- *VAR_IMAP_HOST
352359
- *VAR_IMAP_PORT
353360
- *VAR_IMAP_TLS
354-
- *VAR_KEYCLOAK_URL_API
355-
- *VAR_KEYCLOAK_ADMIN_URL_TOKEN
356361
- *VAR_JMAP_HOST
357362
- *VAR_JMAP_PORT
358363
- *VAR_JMAP_TLS
364+
- *VAR_KEYCLOAK_ADMIN_URL_TOKEN
365+
- *VAR_KEYCLOAK_URL_API
366+
- *VAR_LOG_LEVEL
359367
- *VAR_MIN_CUSTOM_DOMAIN_ALIAS_LENGTH
360368
- *VAR_OIDC_URL_AUTH
361-
- *VAR_OIDC_URL_TOKEN
362-
- *VAR_OIDC_URL_USER
363369
- *VAR_OIDC_URL_JWKS
364370
- *VAR_OIDC_URL_LOGOUT
371+
- *VAR_OIDC_URL_TOKEN
372+
- *VAR_OIDC_URL_USER
365373
- *VAR_PADDLE_ENV
366374
- *VAR_PUBLIC_BASE_URL
367375
- *VAR_REDIS_CELERY_DB
368376
- *VAR_REDIS_CELERY_RESULTS_DB
369377
- *VAR_REDIS_INTERNAL_DB
370378
- *VAR_REDIS_SHARED_DB
379+
- *VAR_SENTRY_PROFILE_SAMPLE_RATE
380+
- *VAR_SENTRY_TRACES_SAMPLE_RATE
371381
- *VAR_SMTP_HOST
372382
- *VAR_SMTP_PORT
373383
- *VAR_SMTP_TLS
@@ -379,11 +389,10 @@ resources:
379389
- *VAR_TB_PRO_WAIT_LIST_URL
380390
- *VAR_USE_ALLOW_LIST
381391
- *VAR_VERIFY_PRIVATE_LINK_SSL
382-
- *VAR_ZENDESK_FORM_ID
383392
- *VAR_ZENDESK_FORM_BROWSER_FIELD_ID
393+
- *VAR_ZENDESK_FORM_ID
384394
- *VAR_ZENDESK_FORM_OS_FIELD_ID
385-
- *VAR_LOG_LEVEL
386-
- *VAR_SENTRY_PROFILE_SAMPLE_RATE
395+
# These vars indicate this container runs as Celery, not Flower or Django
387396
- name: TBA_CELERY
388397
value: "yes"
389398
- name: TBA_FLOWER
@@ -423,11 +432,12 @@ resources:
423432
- *VAR_IMAP_HOST
424433
- *VAR_IMAP_PORT
425434
- *VAR_IMAP_TLS
426-
- *VAR_KEYCLOAK_URL_API
427-
- *VAR_KEYCLOAK_ADMIN_URL_TOKEN
428435
- *VAR_JMAP_HOST
429436
- *VAR_JMAP_PORT
430437
- *VAR_JMAP_TLS
438+
- *VAR_KEYCLOAK_URL_API
439+
- *VAR_KEYCLOAK_ADMIN_URL_TOKEN
440+
- *VAR_LOG_LEVEL
431441
- *VAR_MIN_CUSTOM_DOMAIN_ALIAS_LENGTH
432442
- *VAR_OIDC_URL_AUTH
433443
- *VAR_OIDC_URL_TOKEN
@@ -454,12 +464,21 @@ resources:
454464
- *VAR_ZENDESK_FORM_ID
455465
- *VAR_ZENDESK_FORM_BROWSER_FIELD_ID
456466
- *VAR_ZENDESK_FORM_OS_FIELD_ID
457-
- *VAR_LOG_LEVEL
458467
- *VAR_SENTRY_PROFILE_SAMPLE_RATE
468+
# These vars indicate this container runs as Flower, not Celery or Django
459469
- name: TBA_CELERY
460470
value: "no"
461471
- name: TBA_FLOWER
462472
value: "yes"
473+
# Since this service is on private network space, we allow the API without auth
474+
- name: FLOWER_UNAUTHENTICATED_API
475+
value: 'true'
476+
# Flower is not our product, and it's for infrequent internal use only.
477+
# Disable all Sentry monitoring except for actual errors.
478+
- name: SENTRY_PROFILE_SAMPLE_RATE
479+
value: "0.0"
480+
- name: SENTRY_TRACES_SAMPLE_RATE
481+
value: "0.0"
463482

464483
targets:
465484
flower:
@@ -903,4 +922,3 @@ resources:
903922
- arn:aws:iam::768512802988:role/accounts-stage-fargate-keycloak
904923
- arn:aws:iam::768512802988:role/accounts-stage-afc-accounts-celery-stage
905924
- arn:aws:iam::768512802988:role/accounts-stage-afc-accounts-flower-stage
906-

src/thunderbird_accounts/admin.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Stores admin panel related config classes"""
2+
23
from django.contrib import admin
34
from django.contrib.admin.apps import AdminConfig
45
from django.utils.translation import gettext_lazy as _

src/thunderbird_accounts/authentication/admin/actions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ def admin_add_to_mailchimp_list(modeladmin, request, queryset):
260260
if len(error_titles) > 0:
261261
modeladmin.message_user(
262262
request,
263-
_(f'Encountered the following errors: {', '.join(error_titles.keys())}'),
263+
_(f'Encountered the following errors: {", ".join(error_titles.keys())}'),
264264
messages.ERROR,
265265
)
266266
if sum([success, errors]) == 0:

src/thunderbird_accounts/authentication/exceptions.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ def __init__(self, error, action: Optional[str] = None, oidc_id: Optional[str] =
119119
def __str__(self):
120120
return f'SendExecuteActionsEmailError: {self.error} for {self.action}. <keycloak-id:{self.oidc_id}>'
121121

122+
122123
class AuthenticationUnavailable(RuntimeError):
123124
"""Used in AccountsOIDCBackend to indicate we need to show a service unavailable page."""
124-
pass
125+
126+
pass

src/thunderbird_accounts/authentication/models.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ class AllowListEntry(BaseModel):
102102
103103
If a user is created from an allow list entry their user will generally be populated in the user_id field / user
104104
relationship. (Unless they're created by outside means.)"""
105+
105106
email = models.EmailField(_('email address'), unique=True)
106107
user = models.ForeignKey(
107108
User,

src/thunderbird_accounts/authentication/tests.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,6 @@ def setUp(self):
493493
# Remove any allow list entries
494494
AllowListEntry.objects.all().delete()
495495

496-
497496
def test_create_user_success(self):
498497
claims = {
499498
'sub': '5f75218f-1cb0-49a5-bd1c-e38c3b32dbd2',
@@ -909,9 +908,7 @@ def test_not_on_allowed_list(self, mock_import_user: MagicMock):
909908
},
910909
)
911910
self.assertEqual(response.status_code, 302)
912-
self.assertEqual(
913-
response.headers.get('Location'), waitlist_url, msg=self.get_messages(response)
914-
)
911+
self.assertEqual(response.headers.get('Location'), waitlist_url, msg=self.get_messages(response))
915912

916913
def test_user_already_exists(self, mock_import_user: MagicMock):
917914
"""Test that we check if a user exists before creating a user"""
@@ -963,7 +960,6 @@ def test_alias_already_exists(self, mock_import_user: MagicMock):
963960
self.assertEqual(response.headers.get('Location'), '/sign-up', msg=self.get_messages(response))
964961
self.assertEqual(str(_('You cannot sign-up with that email address.')), self.get_messages(response)[0].message)
965962

966-
967963
def test_passwords_are_empty(self, mock_import_user: MagicMock):
968964
"""Test that we check if passwords exist"""
969965

0 commit comments

Comments
 (0)