Changeset 6979
- Timestamp:
- 12/27/07 15:44:33 (6 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/branches/gis/django/contrib/gis/tests/geoapp/tests.py
r6886 r6979 156 156 htown = fromstr('POINT(1947516.83115183 6322297.06040572)', srid=3084) 157 157 ptown = fromstr('POINT(992363.390841912 481455.395105533)', srid=2774) 158 prec = 3 # Precision is low due to version variations in PROJ and GDAL. 158 159 159 160 # Asserting the result of the transform operation with the values in … … 162 163 h = City.objects.transform('point', srid=htown.srid).get(name='Houston') 163 164 self.assertEqual(3084, h.point.srid) 164 self.assertAlmostEqual(htown.x, h.point.x, 8)165 self.assertAlmostEqual(htown.y, h.point.y, 8)165 self.assertAlmostEqual(htown.x, h.point.x, prec) 166 self.assertAlmostEqual(htown.y, h.point.y, prec) 166 167 167 168 p1 = City.objects.transform('point', srid=ptown.srid).get(name='Pueblo') … … 169 170 for p in [p1, p2]: 170 171 self.assertEqual(2774, p.point.srid) 171 self.assertAlmostEqual(ptown.x, p.point.x, 7)172 self.assertAlmostEqual(ptown.y, p.point.y, 7)172 self.assertAlmostEqual(ptown.x, p.point.x, prec) 173 self.assertAlmostEqual(ptown.y, p.point.y, prec) 173 174 174 175 def test09_disjoint(self): django/branches/gis/django/contrib/gis/tests/test_gdal_geom.py
r6862 r6979 255 255 def test09b_srs_transform(self): 256 256 "Testing transform()." 257 orig = OGRGeometry('POINT (-104.609 252 38.255001)', 4326)258 trans = OGRGeometry('POINT (992363.390841912 481455.395105533)', 2774)257 orig = OGRGeometry('POINT (-104.609 38.255)', 4326) 258 trans = OGRGeometry('POINT (992385.4472045 481455.4944650)', 2774) 259 259 260 260 # Using an srid, a SpatialReference object, and a CoordTransform object … … 267 267 268 268 for p in (t1, t2, t3): 269 self.assertAlmostEqual(trans.x, p.x, 7) 270 self.assertAlmostEqual(trans.y, p.y, 7) 269 prec = 3 270 self.assertAlmostEqual(trans.x, p.x, prec) 271 self.assertAlmostEqual(trans.y, p.y, prec) 271 272 272 273 def test10_difference(self):
