Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
okaycj committed Jan 25, 2023
1 parent 3081a0b commit 332a326
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions web/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,10 +228,15 @@ def test_demographic_data_update_authenticated(self):

# Update data and save
data["country"] = "BR"

# Setting ethnicity to None fixes issue with submitting data.
data["us_race_ethnicity_identification"] = None

cleaned_data = {key: val for (key, val) in data.items() if val is not None}
response = self.client.post(
reverse("web:demographic-data-update"), cleaned_data, follow=True
)
self.assertEqual(response.context["form"].errors, {})
self.assertEqual(
response.redirect_chain, [(reverse("web:demographic-data-update"), 302)]
)
Expand Down

0 comments on commit 332a326

Please sign in to comment.