mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-23 03:06:01 +02:00
Add test cases
This commit is contained in:
parent
638493a6e2
commit
316516710b
2 changed files with 19 additions and 19 deletions
|
@ -2,5 +2,5 @@ agencyid|agencyname|active|isfederal
|
||||||
1|Thoughtstorm|N|Y
|
1|Thoughtstorm|N|Y
|
||||||
2|Minyx|Y|N
|
2|Minyx|Y|N
|
||||||
3|Demivee|N|Y
|
3|Demivee|N|Y
|
||||||
4|InnoZ|Y|Y
|
4|Department of Commerce|Y|Y
|
||||||
5|igorville|Y|N
|
5|InnoZ|Y|Y
|
||||||
|
|
|
@ -49,7 +49,7 @@ class TestMigrations(TestCase):
|
||||||
with patch('registrar.management.commands.utility.terminal_helper.TerminalHelper.query_yes_no_exit', return_value=True):
|
with patch('registrar.management.commands.utility.terminal_helper.TerminalHelper.query_yes_no_exit', return_value=True):
|
||||||
call_command(
|
call_command(
|
||||||
"load_transition_domain",
|
"load_transition_domain",
|
||||||
f"{self.test_data_file_location}/{self.migration_json_filename}",
|
self.migration_json_filename,
|
||||||
directory=self.test_data_file_location
|
directory=self.test_data_file_location
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -62,7 +62,7 @@ class TestMigrations(TestCase):
|
||||||
"master_domain_migrations",
|
"master_domain_migrations",
|
||||||
runMigrations=True,
|
runMigrations=True,
|
||||||
migrationDirectory=self.test_data_file_location,
|
migrationDirectory=self.test_data_file_location,
|
||||||
migration_json_filename=self.migration_json_filename,
|
migrationJSON=self.migration_json_filename,
|
||||||
disablePrompts=True
|
disablePrompts=True
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -190,10 +190,10 @@ class TestMigrations(TestCase):
|
||||||
expected_total_domain_informations = 0
|
expected_total_domain_informations = 0
|
||||||
expected_total_domain_invitations = 0
|
expected_total_domain_invitations = 0
|
||||||
|
|
||||||
expected_missing_domains = 8
|
expected_missing_domains = 9
|
||||||
expected_duplicate_domains = 0
|
expected_duplicate_domains = 0
|
||||||
expected_missing_domain_informations = 8
|
expected_missing_domain_informations = 9
|
||||||
expected_missing_domain_invitations = 8
|
expected_missing_domain_invitations = 9
|
||||||
self.compare_tables(
|
self.compare_tables(
|
||||||
expected_total_transition_domains,
|
expected_total_transition_domains,
|
||||||
expected_total_domains,
|
expected_total_domains,
|
||||||
|
@ -371,15 +371,15 @@ class TestMigrations(TestCase):
|
||||||
self.assertEqual(Users.count(), 1)
|
self.assertEqual(Users.count(), 1)
|
||||||
self.assertEqual(anomaly.creator, Users.get())
|
self.assertEqual(anomaly.creator, Users.get())
|
||||||
|
|
||||||
domain = Domain.objects.filter(name="fakewebsite2.gov")
|
domain = Domain.objects.filter(name="fakewebsite2.gov").get()
|
||||||
fakewebsite_domain_infos = DomainInformation.objects.filter(domain=domain)
|
fakewebsite_domain_infos = DomainInformation.objects.filter(domain=domain)
|
||||||
self.assertEqual(fakewebsite_domain_infos.count(), 1)
|
self.assertEqual(fakewebsite_domain_infos.count(), 1)
|
||||||
|
|
||||||
fakewebsite = fakewebsite_domain_infos.get()
|
fakewebsite = fakewebsite_domain_infos.get()
|
||||||
self.assertEqual(fakewebsite.organization_name, "Flashdog")
|
self.assertEqual(fakewebsite.organization_name, "Fanoodle")
|
||||||
self.assertEqual(fakewebsite.organization_type, None)
|
self.assertEqual(fakewebsite.organization_type, "federal")
|
||||||
self.assertEqual(fakewebsite.federal_agency, None)
|
self.assertEqual(fakewebsite.federal_agency, "Department of Commerce")
|
||||||
self.assertEqual(fakewebsite.federal_type, None)
|
self.assertEqual(fakewebsite.federal_type, "executive")
|
||||||
|
|
||||||
# Check for the "system" creator user
|
# Check for the "system" creator user
|
||||||
Users = User.objects.filter(username="System")
|
Users = User.objects.filter(username="System")
|
||||||
|
@ -393,9 +393,9 @@ class TestMigrations(TestCase):
|
||||||
|
|
||||||
# Analyze the tables
|
# Analyze the tables
|
||||||
expected_total_transition_domains = 9
|
expected_total_transition_domains = 9
|
||||||
expected_total_domains = 4
|
expected_total_domains = 5
|
||||||
expected_total_domain_informations = 4
|
expected_total_domain_informations = 5
|
||||||
expected_total_domain_invitations = 7
|
expected_total_domain_invitations = 8
|
||||||
|
|
||||||
expected_missing_domains = 0
|
expected_missing_domains = 0
|
||||||
expected_duplicate_domains = 0
|
expected_duplicate_domains = 0
|
||||||
|
@ -426,10 +426,10 @@ class TestMigrations(TestCase):
|
||||||
user.first_login()
|
user.first_login()
|
||||||
|
|
||||||
# Analyze the tables
|
# Analyze the tables
|
||||||
expected_total_transition_domains = 8
|
expected_total_transition_domains = 9
|
||||||
expected_total_domains = 4
|
expected_total_domains = 5
|
||||||
expected_total_domain_informations = 4
|
expected_total_domain_informations = 5
|
||||||
expected_total_domain_invitations = 7
|
expected_total_domain_invitations = 8
|
||||||
|
|
||||||
expected_missing_domains = 0
|
expected_missing_domains = 0
|
||||||
expected_duplicate_domains = 0
|
expected_duplicate_domains = 0
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue