Skip to content

Conversation

@cecilialau6776
Copy link
Contributor

@cecilialau6776 cecilialau6776 commented Oct 2, 2025

Fixed some tests

  • Project view tests
    • ProjectUserDetail expects a ProjectUser pk, but the test provides a User pk. This PR fixes that and provides the correct pk.
  • AllocationChangeViewTest
    • The AllocationChangeViewTest set the url to "/allocation/1/change-request". This PR changes it to f"/allocation/{self.allocation.pk}/change-request", fixing a 404 reply.
  • ProjectListViewTest.test_project_list_search
  • coldfront.core.allocation.tests.test_models
    • Untested; couldn't reproduce original bug
    • Replaced timezone.now() calls in test_models.py with datetime.date.now(), since that's what the model uses.

@aebruno
Copy link
Member

aebruno commented Oct 9, 2025

@cecilialau6776 Thanks! Can you please squash into single commit.

@cecilialau6776 cecilialau6776 force-pushed the test_fixes branch 2 times, most recently from 8334d4b to f35a961 Compare October 9, 2025 16:36
@cecilialau6776
Copy link
Contributor Author

Yup! Squashed and rebased.

USERNAME = "Username"
FIELD_OF_SCIENCE = "Field of Science"

last_name = forms.CharField(label=TITLE, max_length=255, required=False)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you double check the variable name here. Should this be title?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you're right! Thanks for the catch :)

Squashed commits:
- fix project view tests
- fix allocation change view tests
- fix ProjectListViewTest.test_project_list_search and add title to
  project search
- fix allocation expiry tests
- replaced `timezone.now()` calls in test_models.py with
  `datetime.date.now()`, since that's what the model uses

Signed-off-by: Cecilia Lau <[email protected]>
@aebruno aebruno merged commit a4b6b4c into ubccr:main Oct 21, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: coldfront.core.project.test_views.ProjectListViewTest.test_project_list_search is Flaky

2 participants