Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#20838 closed Bug (fixed)

Geodjango spatialrefsys test fails with postgis-2.0.3

Reported by: Harm Geerts <hgeerts@…> Owned by: nobody
Component: GIS Version: dev
Severity: Normal Keywords: postgis, geodjango
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

FAIL: test01_retrieve (django.contrib.gis.tests.test_spatialrefsys.SpatialRefSysTest)
Testing retrieval of SpatialRefSys model objects.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/harm/dev/django/django/contrib/gis/tests/test_spatialrefsys.py", line 58, in test01_retrieve
    six.assertRegex(self, srs.proj4text, sd['proj4_re'])
  File "/home/harm/dev/django/django/utils/six.py", line 430, in assertRegex
    return getattr(self, _assertRegex)(*args, **kwargs)
AssertionError: Regexp didn't match: '\\+proj=lcc \\+lat_1=30.28333333333333 \\+lat_2=28.38333333333333 \\+lat_0=27.83333333333333 \\+lon_0=-99 \\+x_0=600000 \\+y_0=4000000 (\\+ellps=GRS80 )?(\\+datum=NAD83 |\\+towgs84=0,0,0,0,0,0,0)?\\+units=m \\+no_defs ' not found in u'+proj=lcc +lat_1=30.28333333333333 +lat_2=28.38333333333333 +lat_0=27.83333333333333 +lon_0=-99 +x_0=600000 +y_0=4000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs '

======================================================================
FAIL: test02_osr (django.contrib.gis.tests.test_spatialrefsys.SpatialRefSysTest)
Testing getting OSR objects from SpatialRefSys model objects.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/harm/dev/django/django/contrib/gis/tests/test_spatialrefsys.py", line 77, in test02_osr
    six.assertRegex(self, srs.proj4, sd['proj4_re'])
  File "/home/harm/dev/django/django/utils/six.py", line 430, in assertRegex
    return getattr(self, _assertRegex)(*args, **kwargs)
AssertionError: Regexp didn't match: '\\+proj=lcc \\+lat_1=30.28333333333333 \\+lat_2=28.38333333333333 \\+lat_0=27.83333333333333 \\+lon_0=-99 \\+x_0=600000 \\+y_0=4000000 (\\+ellps=GRS80 )?(\\+datum=NAD83 |\\+towgs84=0,0,0,0,0,0,0)?\\+units=m \\+no_defs ' not found in u'+proj=lcc +lat_1=30.28333333333333 +lat_2=28.38333333333333 +lat_0=27.83333333333333 +lon_0=-99 +x_0=600000 +y_0=4000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs '

Change History (5)

comment:1 by Harm Geerts <hgeerts@…>, 11 years ago

Has patch: set

comment:2 by Tim Graham, 11 years ago

Triage Stage: UnreviewedAccepted

I confirm this fixes the test failures on djangocorebox 1.1. I guess jenkins uses different dependencies? Could this break the test there?

comment:3 by Harm Geerts <hgeerts@…>, 11 years ago

The old regex is defined as: r'(\+datum=NAD83 |\+towgs84=0,0,0,0,0,0,0)?\+units=m \+no_defs '
So jenkins would only pass with one of:
... +units=m +no_defs
... +datum=NAD83 +units=m +no_defs
... +towgs84=0,0,0,0,0,0,0+units=m +no_defs

where the latter clearly is erroneous so it's likely jenkins passes with the first or second string.
I'm not sure how the notation is affected by deps and if so, which one causes it to use +towgs84 but that seems like a reasonable assumption.

comment:4 by Tim Graham <timograham@…>, 11 years ago

Resolution: fixed
Status: newclosed

In fd0d48646760c3024ce605d919d69c8b8449382d:

Fixed #20838 -- Fixed Geodjango spatialrefsys test failure with postgis-2.0.3

comment:5 by Tim Graham <timograham@…>, 11 years ago

In b0bde218847692096b08d27aa37eba1745cacca8:

[1.6.x] Fixed #20838 -- Fixed Geodjango spatialrefsys test failure with postgis-2.0.3

Backport of fd0d486467 from master

Note: See TracTickets for help on using tickets.
Back to Top