[Django] #34305: Refactor the GeoIP2 tests to use MaxMind test data

6 views
Skip to first unread message

Django

unread,
Jan 31, 2023, 3:54:13 PM1/31/23
to django-...@googlegroups.com
#34305: Refactor the GeoIP2 tests to use MaxMind test data
-------------------------------------+-------------------------------------
Reporter: Jacob | Owner: Tom Forbes
Walls |
Type: | Status: assigned
Cleanup/optimization |
Component: GIS | Version: dev
Severity: Normal | Keywords:
Triage Stage: | Has patch: 1
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
Attempted to run the `gis_tests` today. Ran into the django-docker-box
[https://github.com/django/django-docker-box/issues/14 issue] that depends
on a refactor in Django itself, so opening a ticket here to track that
work.

Essentially, Tom Forbes proposes committing MaxMind test data to the
django repo to enable the `test_geoip2` to run without having to download
the city and country test files. Looking at the PR, a small refactor was
also necessary to enable using `@override_settings` to point to the files.

[https://github.com/django/django/pull/14215 PR]

--
Ticket URL: <https://code.djangoproject.com/ticket/34305>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Feb 1, 2023, 2:32:52 AM2/1/23
to django-...@googlegroups.com
#34305: Refactor the GeoIP2 tests to use MaxMind test data
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: Tom
Type: | Forbes
Cleanup/optimization | Status: assigned
Component: GIS | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Claude Paroz):

* stage: Unreviewed => Accepted


Comment:

Looks good! Please refer to this ticket number in the commit message.

--
Ticket URL: <https://code.djangoproject.com/ticket/34305#comment:1>

Django

unread,
Feb 1, 2023, 3:11:45 AM2/1/23
to django-...@googlegroups.com
#34305: Refactor the GeoIP2 tests to use MaxMind test data
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: Tom
Type: | Forbes
Cleanup/optimization | Status: assigned
Component: GIS | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* needs_better_patch: 0 => 1


Comment:

Both PRs are no longer mergeable.

--
Ticket URL: <https://code.djangoproject.com/ticket/34305#comment:2>

Django

unread,
Dec 5, 2023, 10:45:42 AM12/5/23
to django-...@googlegroups.com
#34305: Refactor the GeoIP2 tests to use MaxMind test data
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: Nick Pope
Type: | Status: assigned
Cleanup/optimization |

Component: GIS | Version: dev
Severity: Normal | Resolution:
Keywords: geoip, geoip2, | Triage Stage: Accepted
maxmind, maxmind-db, mmdb |

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Nick Pope):

* keywords: => geoip, geoip2, maxmind, maxmind-db, mmdb
* needs_better_patch: 1 => 0
* owner: Tom Forbes => Nick Pope


Comment:

[https://github.com/django/django/pull/17575 PR]

--
Ticket URL: <https://code.djangoproject.com/ticket/34305#comment:3>

Django

unread,
Dec 12, 2023, 4:00:04 AM12/12/23
to django-...@googlegroups.com
#34305: Refactor the GeoIP2 tests to use MaxMind test data
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: Nick Pope
Type: | Status: assigned
Cleanup/optimization |
Component: GIS | Version: dev
Severity: Normal | Resolution:
Keywords: geoip, geoip2, | Triage Stage: Ready for
maxmind, maxmind-db, mmdb | checkin

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/34305#comment:4>

Django

unread,
Dec 12, 2023, 5:58:59 AM12/12/23
to django-...@googlegroups.com
#34305: Refactor the GeoIP2 tests to use MaxMind test data
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: Nick Pope
Type: | Status: closed

Cleanup/optimization |
Component: GIS | Version: dev
Severity: Normal | Resolution: fixed

Keywords: geoip, geoip2, | Triage Stage: Ready for
maxmind, maxmind-db, mmdb | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"a93375e8ab26e7cb22c6ee7e4bf23bf2d6ed170d" a93375e8]:
{{{
#!CommitTicketReference repository=""
revision="a93375e8ab26e7cb22c6ee7e4bf23bf2d6ed170d"
Fixed #34305 -- Changed GeoIP2 tests to use MaxMind test databases.

GEOIP_SETTINGS is removed from the global scope as this prevents
modifications to the settings using @override_settings in tests.

Additional improvements now that we have stable test databases include:

- Made testing more comprehensive and improved coverage
- Patched socket.gethostbyname() for whole test case
- Added testing of non-free GeoIP2 databases

Co-authored-by: Tom Forbes <t...@tomforb.es>
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/34305#comment:6>

Django

unread,
Dec 12, 2023, 5:59:00 AM12/12/23
to django-...@googlegroups.com
#34305: Refactor the GeoIP2 tests to use MaxMind test data
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: Nick Pope
Type: | Status: assigned

Cleanup/optimization |
Component: GIS | Version: dev
Severity: Normal | Resolution:
Keywords: geoip, geoip2, | Triage Stage: Ready for
maxmind, maxmind-db, mmdb | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"ed4f83782d9f3404ad600f6131ef78244ff1e162" ed4f837]:
{{{
#!CommitTicketReference repository=""
revision="ed4f83782d9f3404ad600f6131ef78244ff1e162"
Refs #34305 -- Added SimpleTestCase.enterClassContext() on Python < 3.11.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/34305#comment:5>

Reply all
Reply to author
Forward
0 new messages