diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2019-02-19 18:28:10 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2019-04-24 19:38:56 +0200 |
commit | eb5c5b81bb4586eaadf408c4c95eca2ee26e9e6e (patch) | |
tree | 97ca3ad47f32e5fa7c1ea26683aace7422db958a | |
parent | 4f63ed814f96bbc68c22c98b799c3911d62aa737 (diff) | |
download | Ishtar-eb5c5b81bb4586eaadf408c4c95eca2ee26e9e6e.tar.bz2 Ishtar-eb5c5b81bb4586eaadf408c4c95eca2ee26e9e6e.zip |
Fix test configuration
-rw-r--r-- | archaeological_finds/tests.py | 6 | ||||
-rw-r--r-- | ishtar_common/tests.py | 1 | ||||
-rw-r--r-- | ishtar_common/utils.py | 5 |
3 files changed, 8 insertions, 4 deletions
diff --git a/archaeological_finds/tests.py b/archaeological_finds/tests.py index d9be3d25d..7303ed56d 100644 --- a/archaeological_finds/tests.py +++ b/archaeological_finds/tests.py @@ -955,6 +955,10 @@ class FindQATest(FindInit, TestCase): url = reverse('find-qa-packaging', args=[pks]) response = c.get(url) self.assertRedirects(response, '/') + profile, created = IshtarSiteProfile.objects.get_or_create( + slug='default', active=True) + profile.warehouse = False + profile.save() c = Client() c.login(username=self.username, password=self.password) @@ -962,8 +966,6 @@ class FindQATest(FindInit, TestCase): # warehouse profile must be activated self.assertEqual(response.status_code, 404) - profile, created = IshtarSiteProfile.objects.get_or_create( - slug='default', active=True) profile.warehouse = True profile.save() response = c.get(url) diff --git a/ishtar_common/tests.py b/ishtar_common/tests.py index 55c43ac21..53db0baae 100644 --- a/ishtar_common/tests.py +++ b/ishtar_common/tests.py @@ -1577,6 +1577,7 @@ class GeomaticTest(TestCase): self.z = z self.spatial_reference_system = spatial_reference_system self.point_source = 'P' + self.point_source_item = "" self.point = point self.point_2d = point_2d diff --git a/ishtar_common/utils.py b/ishtar_common/utils.py index 2aa8db298..a263f3640 100644 --- a/ishtar_common/utils.py +++ b/ishtar_common/utils.py @@ -494,7 +494,9 @@ def post_save_geo(sender, **kwargs): # is loaded before models instance = kwargs.get('instance') - current_source = unicode(instance.__class__._meta.verbose_name) + current_source = "default" + if hasattr(instance.__class__, "_meta"): + current_source = unicode(instance.__class__._meta.verbose_name) if instance.point_source_item and \ instance.point_source_item != current_source: # refetch instance.point, instance.point_2d = None, None @@ -505,7 +507,6 @@ def post_save_geo(sender, **kwargs): point_2d = instance.point_2d profile = get_current_profile() modified = False - print (instance) if (point or point_2d) and instance.x is None and not \ instance.point_source: # db source |