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

Investigate / Resolve failing test #125

Closed
banagale opened this issue Aug 19, 2020 · 2 comments
Closed

Investigate / Resolve failing test #125

banagale opened this issue Aug 19, 2020 · 2 comments
Assignees
Labels
Hot High Priority Ticket
Milestone

Comments

@banagale
Copy link
Collaborator

Run python example_site/manage.py test example_site/
Creating test database for alias 'default'...
............................F....

System check identified no issues (0 silenced).
FAIL: test_unique_name_state (address.tests.test_models.LocalityTestCase)

Traceback (most recent call last):
File "/home/runner/work/django-address/django-address/example_site/address/tests/test_models.py", line 101, in test_unique_name_state
self.assertRaises(IntegrityError, Locality.objects.create, name='Melbourne', state=self.au_vic)
AssertionError: IntegrityError not raised by create


Ran 33 tests in 0.080s

FAILED (failures=1)
Destroying test database for alias 'default'...
##[error]Process completed with exit code 1.

@banagale banagale added this to the Version 0.2.5 milestone Aug 19, 2020
@banagale banagale self-assigned this Aug 19, 2020
@banagale banagale added In-Progress This ticket is in active development Hot High Priority Ticket labels Aug 29, 2020
@banagale
Copy link
Collaborator Author

banagale commented Aug 29, 2020

What does this test do?

  • Tests to ensure a locality with a given name must have a unique state
        Locality.objects.create(name='Melbourne', state=self.au_qld)
        Locality.objects.create, name='Melbourne', state=self.au_vic)

Led to an integrity error at some point.

Looks like the unique requirement was removed in 2015. :)

Questions from this ticket:

  • Maybe there was a unique together on the fk to state previously?
  • Look at the history of the Locality model definition
    Answers:

Yes, Locality had a unique together previously and that had been commented out 5 years ago. The test was never updated so it appears the test has been broken since then.

Questions for the future:

banagale referenced this issue Aug 29, 2020
addresses. Also added a filter in the admin to show only unidentified
addresses.
@banagale
Copy link
Collaborator Author

Fixed in 0c83884.

@banagale banagale removed the In-Progress This ticket is in active development label Aug 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Hot High Priority Ticket
Projects
None yet
Development

No branches or pull requests

1 participant