Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -4339,11 +4339,7 @@ def check(self, element):


class GovernmentBodyExternalId(base.BaseRule):
"""Warns if the government body is set using an external identifier instead of the GovernmentBody element.

This rule will be upgraded to an error once all feeds are migrated to the new
schema.
"""
"""Errors if the government body is set using an external identifier instead of the GovernmentBody element."""

def elements(self):
return ["ExternalIdentifiers"]
Expand All @@ -4352,7 +4348,7 @@ def check(self, element):
if get_external_id_values(
element, "government-body"
) or get_external_id_values(element, "governmental-body"):
raise loggers.ElectionWarning.from_message(
raise loggers.ElectionError.from_message(
"Specifying government body via external identifiers is deprecated."
" Please use the top level GovernmentBody element instead."
)
Expand Down
4 changes: 2 additions & 2 deletions tests/rules_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -11533,7 +11533,7 @@ def testGovernmentBodyExternalId(self):
</Office>
"""

with self.assertRaises(loggers.ElectionWarning) as cm:
with self.assertRaises(loggers.ElectionError) as cm:
self.validator.check(etree.fromstring(government_body_string))
self.assertEqual(
cm.exception.log_entry[0].message,
Expand All @@ -11554,7 +11554,7 @@ def testGovernmentalBodyExternalId(self):
</Office>
"""

with self.assertRaises(loggers.ElectionWarning) as cm:
with self.assertRaises(loggers.ElectionError) as cm:
self.validator.check(etree.fromstring(government_body_string))
self.assertEqual(
cm.exception.log_entry[0].message,
Expand Down
2 changes: 1 addition & 1 deletion version.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
See https://packaging.python.org/guides/single-sourcing-package-version/
"""

__version__ = '1.49.dev3'
__version__ = '1.49.dev4'