un33k/django-ipware

Tests fail with python-ipware 2.0.4

jwhitlock opened this issue · 2 comments

With python-ipware 2.0.3, 4 tests pass.

With python-ipware 2.0.4, 1 test passes and 3 fail. Our project also had test failures extracting an IP address with 2.0.4.

Found 4 test(s).
Creating test database for alias 'default'...
System check identified no issues (0 silenced).
FFF.
======================================================================
FAIL: test_load (ipware.tests.tests_ip.IpTestCase.test_load)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/john/src/django-ipware/ipware/tests/tests_ip.py", line 20, in test_load
    self.assertEqual(result, ("177.139.233.139", True))
AssertionError: Tuples differ: (None, False) != ('177.139.233.139', True)

First differing element 0:
None
'177.139.233.139'

- (None, False)
+ ('177.139.233.139', True)

======================================================================
FAIL: test_meta_proxy_order_left_most (ipware.tests.tests_ip.IpTestCase.test_meta_proxy_order_left_most)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/john/src/django-ipware/ipware/tests/tests_ip.py", line 28, in test_meta_proxy_order_left_most
    self.assertEqual(result, ("177.139.233.139", True))
AssertionError: Tuples differ: (None, False) != ('177.139.233.139', True)

First differing element 0:
None
'177.139.233.139'

- (None, False)
+ ('177.139.233.139', True)

======================================================================
FAIL: test_meta_proxy_trusted_ips_exact_ip_check (ipware.tests.tests_ip.IpTestCase.test_meta_proxy_trusted_ips_exact_ip_check)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/john/src/django-ipware/ipware/tests/tests_ip.py", line 44, in test_meta_proxy_trusted_ips_exact_ip_check
    self.assertEqual(result, ("177.139.233.139", True))
AssertionError: Tuples differ: (None, False) != ('177.139.233.139', True)

First differing element 0:
None
'177.139.233.139'

- (None, False)
+ ('177.139.233.139', True)

----------------------------------------------------------------------
Ran 4 tests in 0.001s

FAILED (failures=3)
Destroying test database for alias 'default'...

Yeah, I have to revert the last changes ... and release a major breaking changes later. Thx for reporting and stay tuned for 2.0.5 soon.

We have decided to move forward with the release of major version 7.0.1. All tests are passing. However, since the enforcement of the proxy_count=0 check has been added, along with AI enhancements, there might be minimal backward incompatibility issues in some localized tests, which I encourage users to address. Alternatively, users can pin python-ipware to version 2.0.3.