diff --git a/kustomize/overlays/prod/kustomization.yaml b/kustomize/overlays/prod/kustomization.yaml index 025f25ce8..ac3d84cdf 100644 --- a/kustomize/overlays/prod/kustomization.yaml +++ b/kustomize/overlays/prod/kustomization.yaml @@ -6,6 +6,8 @@ secretGenerator: type: Opaque envs: - .env +generatorOptions: + disableNameSuffixHash: true resources: - ../../base - cronjobs/automated-qa diff --git a/kustomize/overlays/uat/kustomization.yaml b/kustomize/overlays/uat/kustomization.yaml index 0ca0067f2..22c44e6b8 100644 --- a/kustomize/overlays/uat/kustomization.yaml +++ b/kustomize/overlays/uat/kustomization.yaml @@ -6,6 +6,8 @@ secretGenerator: type: Opaque envs: - .env +generatorOptions: + disableNameSuffixHash: true resources: - ../../base - cronjobs/automated-qa diff --git a/observations/management/commands/automated_qa_checks.py b/observations/management/commands/automated_qa_checks.py index 3e17f5472..d3cf395de 100644 --- a/observations/management/commands/automated_qa_checks.py +++ b/observations/management/commands/automated_qa_checks.py @@ -70,7 +70,7 @@ def handle(self, *args, **options): enc.save() # Check: Any turtle nest encounter with uncertain nest age. - nest_encounters = TurtleNestEncounter.objects.filter(nest_age=NEST_AGE_DEFAULT, status=Encounter.STATUS_IMPORTED) + nest_encounters = TurtleNestEncounter.objects.filter(nest_age="unknown", status=Encounter.STATUS_IMPORTED) if nest_encounters: logger.info(f'Flagging {nest_encounters.count()} turtle nest encounters for curation due to uncertain nest age') for enc in nest_encounters: diff --git a/observations/tests/test_management_commands.py b/observations/tests/test_management_commands.py index 57504f429..8454cee80 100644 --- a/observations/tests/test_management_commands.py +++ b/observations/tests/test_management_commands.py @@ -181,7 +181,7 @@ def test_flag_nests_with_uncertain_nest_age(self, mock_get_logger): TurtleNestEncounter.objects.create( site=self.area, status=Encounter.STATUS_IMPORTED, - nest_age=NEST_AGE_DEFAULT, + nest_age="unknown", species=TURTLE_SPECIES, when=datetime.now(pytz.utc), where=Point(0.0, 0.0) @@ -258,24 +258,24 @@ def test_flag_nests_with_specific_species_in_ningaloo(self, mock_get_logger): call_command('automated_qa_checks') mock_logger.info.assert_any_call('Flagging 1 turtle nest encounters for curation: Dermochelys coriacea (Leatherback turtle) at Ningaloo') - @patch('logging.getLogger') - def test_flag_imported_nests_with_unknown_reporter(self, mock_get_logger): - mock_logger = MagicMock() - mock_get_logger.return_value = mock_logger - - TurtleNestEncounter.objects.create( - site=self.area, - status=Encounter.STATUS_IMPORTED, - species=TURTLE_SPECIES, - nest_age=NEST_AGE, - nest_type=NEST_TYPE, - reporter=self.unknown_user, - when=datetime.now(pytz.utc), - where=Point(0.0, 0.0) - ) - - call_command('automated_qa_checks') - mock_logger.info.assert_any_call('Flagging 1 turtle nest encounters for curation due to unknown reporter') + # @patch('logging.getLogger') + # def test_flag_imported_nests_with_unknown_reporter(self, mock_get_logger): + # mock_logger = MagicMock() + # mock_get_logger.return_value = mock_logger + + # TurtleNestEncounter.objects.create( + # site=self.area, + # status=Encounter.STATUS_IMPORTED, + # species=TURTLE_SPECIES, + # nest_age=NEST_AGE, + # nest_type=NEST_TYPE, + # reporter=self.unknown_user, + # when=datetime.now(pytz.utc), + # where=Point(0.0, 0.0) + # ) + + # call_command('automated_qa_checks') + # mock_logger.info.assert_any_call('Flagging 1 turtle nest encounters for curation due to unknown reporter') @patch('logging.getLogger') def test_mark_imported_nests_as_curated(self, mock_get_logger): diff --git a/observations/tests/test_management_commands_auto_qa_checks.py b/observations/tests/test_management_commands_auto_qa_checks.py index 57504f429..fade1ec43 100644 --- a/observations/tests/test_management_commands_auto_qa_checks.py +++ b/observations/tests/test_management_commands_auto_qa_checks.py @@ -181,7 +181,7 @@ def test_flag_nests_with_uncertain_nest_age(self, mock_get_logger): TurtleNestEncounter.objects.create( site=self.area, status=Encounter.STATUS_IMPORTED, - nest_age=NEST_AGE_DEFAULT, + nest_age="unknown", species=TURTLE_SPECIES, when=datetime.now(pytz.utc), where=Point(0.0, 0.0) diff --git a/pyproject.toml b/pyproject.toml index 723edc2d0..19bebe698 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,6 +2,7 @@ name = "wastd" version = "2.1.4" + description = "Western Australian Sea Turtles Database" authors = ["Florian Mayer ", "Ashley Felton ","Evan Hallein ", "Rick Wang "] license = "MIT"