-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3193 from GSA-TTS/main
- Loading branch information
Showing
8 changed files
with
100 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
from datetime import datetime, timedelta | ||
from django.conf import settings | ||
from django.test import SimpleTestCase | ||
|
||
from .sac_general_lib.general_information import ( | ||
|
@@ -10,6 +11,7 @@ | |
xform_auditee_fiscal_period_start, | ||
xform_country, | ||
xform_entity_type, | ||
xform_replace_empty_auditor_email, | ||
) | ||
from .exception_utils import ( | ||
DataMigrationError, | ||
|
@@ -211,3 +213,23 @@ def test_missing_audit_type(self): | |
general_information = {} | ||
with self.assertRaises(DataMigrationError): | ||
xform_audit_type(general_information) | ||
|
||
|
||
class TestXformReplaceEmptyAuditorEmail(SimpleTestCase): | ||
def test_empty_auditor_email(self): | ||
"""Test that an empty auditor_email is replaced with 'GSA_MIGRATION'""" | ||
input_data = {"auditor_email": ""} | ||
expected_output = {"auditor_email": settings.GSA_MIGRATION} | ||
self.assertEqual(xform_replace_empty_auditor_email(input_data), expected_output) | ||
|
||
def test_non_empty_auditor_email(self): | ||
"""Test that a non-empty auditor_email remains unchanged""" | ||
input_data = {"auditor_email": "[email protected]"} | ||
expected_output = {"auditor_email": "[email protected]"} | ||
self.assertEqual(xform_replace_empty_auditor_email(input_data), expected_output) | ||
|
||
def test_missing_auditor_email(self): | ||
"""Test that a missing auditor_email key is added and set to 'GSA_MIGRATION'""" | ||
input_data = {} | ||
expected_output = {"auditor_email": settings.GSA_MIGRATION} | ||
self.assertEqual(xform_replace_empty_auditor_email(input_data), expected_output) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters