Convert domain list to YAML

YAML is easier to edit than Python code, and having it in the root
directory of the app makes it nice and easy to find.
This commit is contained in:
Chris Hill-Scott
2018-02-06 11:02:54 +00:00
parent 91ab54e9c1
commit f93ef2eb3d
3 changed files with 73 additions and 69 deletions

View File

@@ -335,3 +335,26 @@ def test_get_valid_government_domain_some_known_details():
assert government_domain.sector is None
assert government_domain.owner == "Marine Management Organisation"
assert government_domain.agreement_signed is False
def test_validate_government_domain_data():
for domain in GovernmentDomain.domains.keys():
government_domain = GovernmentDomain(domain)
assert government_domain.sector in {
'local', 'central', None
}
assert (
government_domain.owner is None
) or (
isinstance(government_domain.owner, str)
)
assert (
government_domain.agreement_signed is True
) or (
government_domain.agreement_signed is False
)