Skip to content

Commit

Permalink
Changes as per Rachael & George's comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
brunns committed Jun 17, 2024
1 parent 19bee89 commit 4d3f294
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions django_app/redbox_app/redbox_core/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,16 +324,16 @@ def get(self, request: HttpRequest) -> HttpResponse:
class DemographicsForm(forms.ModelForm):
class Meta:
model = User
fields = ("grade", "profession", "business_unit")
fields = ("business_unit", "grade", "profession")
labels: ClassVar[Mapping[str, str]] = {
"business_unit": "Business unit",
"grade": "Grade",
"profession": "Profession",
"business_unit": "Business unit",
}
widgets: ClassVar[Mapping[str, forms.Widget]] = {
"business_unit": forms.Select(attrs={"class": "govuk-select"}),
"grade": forms.Select(attrs={"class": "govuk-select"}),
"profession": forms.Select(attrs={"class": "govuk-select"}),
"business_unit": forms.Select(attrs={"class": "govuk-select"}),
}


Expand Down
2 changes: 1 addition & 1 deletion django_app/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def jemima_puddleduck():


@pytest.fixture()
def mrs_tiggywinkle(business_unit: BusinessUnit) -> User:
def user_with_demographic_data(business_unit: BusinessUnit) -> User:
return User.objects.create_user(
email="[email protected]", grade="DG", business_unit=business_unit, profession="AN"
)
Expand Down
8 changes: 4 additions & 4 deletions django_app/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,9 +347,9 @@ def test_check_demographics_redirect_if_unpopulated(client: Client, alice: User)


@pytest.mark.django_db()
def test_check_demographics_redirect_if_populated(client: Client, mrs_tiggywinkle: User):
def test_check_demographics_redirect_if_populated(client: Client, user_with_demographic_data: User):
# Given
client.force_login(mrs_tiggywinkle)
client.force_login(user_with_demographic_data)

# When
response = client.get("/check-demographics/", follow=True)
Expand All @@ -359,9 +359,9 @@ def test_check_demographics_redirect_if_populated(client: Client, mrs_tiggywinkl


@pytest.mark.django_db()
def test_view_demographic_details_form(client: Client, mrs_tiggywinkle: User):
def test_view_demographic_details_form(client: Client, user_with_demographic_data: User):
# Given
client.force_login(mrs_tiggywinkle)
client.force_login(user_with_demographic_data)

# When
response = client.get("/demographics/")
Expand Down

0 comments on commit 4d3f294

Please sign in to comment.