diff options
Diffstat (limited to 'archaeological_finds/tests.py')
-rw-r--r-- | archaeological_finds/tests.py | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/archaeological_finds/tests.py b/archaeological_finds/tests.py index 3d4d6f1d7..6426cf38b 100644 --- a/archaeological_finds/tests.py +++ b/archaeological_finds/tests.py @@ -1672,6 +1672,37 @@ class GeomaticTest(FindInit, TestCase): def setUp(self): self.create_finds(data_base={"label": u"Find 1"}, force=True) + def test_point_precision(self): + self.username = 'myuser' + self.password = 'mypassword' + User.objects.create_superuser(self.username, 'myemail@test.com', + self.password) + profile, created = IshtarSiteProfile.objects.get_or_create( + slug='default', active=True) + profile.mapping = True + profile.save() + wgs84 = SpatialReferenceSystem.objects.get(srid=4326) + find = self.finds[0] + base_find = find.base_finds.all()[0] + self.assertEqual(base_find.x, None) + + base_find.x, base_find.y = 33.12999, 42.78945 + base_find.spatial_reference_system = wgs84 + base_find.save() + + find = base_find.find.all()[0] + c = Client() + c.login(username=self.username, password=self.password) + response = c.get( + reverse('show-find', kwargs={'pk': find.pk})) + self.assertIn(b'33.12999', response.content) + profile.point_precision = 2 + profile.save() + + response = c.get( + reverse('show-find', kwargs={'pk': find.pk})) + self.assertIn(b'33.13', response.content) + def test_update_container_localisation_on_warehouse_update(self): profile, created = IshtarSiteProfile.objects.get_or_create( slug='default', active=True) |