Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consistently use make_fake_X in tests and allow fields to be set to None in make_fakes #1710

Merged
merged 5 commits into from
Nov 29, 2024

Conversation

dchiller
Copy link
Contributor

@dchiller dchiller commented Nov 14, 2024

Updates tests to consistently use make_fake_[model] functions. Updates use of these functions for the new argument structure.

Fixes various type and linting issues in make_fakes.

Closes #1709.

Also fixes an intermittently-failing test (SourceListViewTest.test_ordering) caused by a case where multiple fake institutions had the same country. Refines the sorting function used to determine the expected order of fake sources in the test. Also modifies make_fake_institution to remove randomness: users of this function should now specify whether the institution has a siglum or is_private_collector. SourceListViewTest.test_ordering is updated to include a variety of different institutions/source combinations (sources with no holding institution, sources with private collector institutions, sources with the same institution, etc.).

Update tests to consistently use `make_fake_[model]` functions. Update use of these functions for the new argument structure.

Fix various type and linting issues in `make_fakes`.
@dchiller dchiller marked this pull request as draft November 14, 2024 16:00
Fix intermittently failing test by increasing types of institutions tested in SourceListViewTest.test_ordering. Adjust expected ordering tuples to account for these institutions.

Removes random assignment of a fake institutions `is_private_collector` field.
@dchiller dchiller merged commit 3363cb9 into DDMAL:develop Nov 29, 2024
1 check passed
@dchiller dchiller deleted the i1709-consistent-use-make-fakes branch November 29, 2024 19:36
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.

make_fake_X doesn't let you create objects with field = None
2 participants