Skip to content

Commit

Permalink
More coverage cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
amstilp committed Nov 13, 2024
1 parent c7d6c8d commit bcf26a5
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions anvil_consortium_manager/tests/test_forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -699,13 +699,13 @@ class Meta:
fields = ("billing_project", "name", "authorization_domains")

def clean_authorization_domains(self):
# No return statement because the test never gets there, and it breaks coverage.
authorization_domains = self.cleaned_data.get("authorization_domains")
if authorization_domains:
for auth_domain in authorization_domains:
print(auth_domain.name)
if auth_domain.name == "invalid-name":
raise forms.ValidationError("Test error")
return authorization_domains # pragma: no cover

class TestWorkspaceCloneForm(forms.WorkspaceCloneFormMixin, TestWorkspaceForm):
class Meta(TestWorkspaceForm.Meta):
Expand Down Expand Up @@ -737,9 +737,6 @@ class Meta:

def clean_authorization_domains(self):
authorization_domains = self.cleaned_data.get("authorization_domains")
if authorization_domains:
for auth_domain in authorization_domains:
print(auth_domain.name)
return authorization_domains

class TestWorkspaceCloneForm(forms.WorkspaceCloneFormMixin, TestWorkspaceForm):
Expand Down

0 comments on commit bcf26a5

Please sign in to comment.