furious-luke / django-address

A Django address model and field. Addresses may be specified by address components or by performing an automatic Google Maps lookup.
BSD 3-Clause "New" or "Revised" License
431 stars 181 forks source link

Investigate / Resolve failing test #125

Closed banagale closed 4 years ago

banagale commented 4 years ago

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 commented 4 years ago

What does this test do?

        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:

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 commented 4 years ago

Fixed in 0c838848dc7247199ad1608bde46ba4d9b2b04f8.