Skip to content

Commit

Permalink
test(source): fix failing tests in SourceEditViewTest and SourceCreat…
Browse files Browse the repository at this point in the history
…eViewTest

- add holding institution required field
  • Loading branch information
lucasmarchd01 committed Aug 23, 2024
1 parent c7f760c commit 86d22c5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions django/cantusdb_project/main_app/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -4679,10 +4679,12 @@ def test_url_and_templates(self):
self.assertTemplateUsed(response, "source_create.html")

def test_create_source(self):
hinst = make_fake_institution(siglum="FA-Ke")
response = self.client.post(
reverse("source-create"),
{
"shelfmark": "test-shelfmark", # shelfmark is a required field
"holding_institution": hinst.id, # holding institution is a required field
},
)

Expand Down Expand Up @@ -4729,11 +4731,13 @@ def test_url_and_templates(self):

def test_edit_source(self):
source = make_fake_source()
hinst = make_fake_institution(siglum="FA-Ke")

response = self.client.post(
reverse("source-edit", args=[source.id]),
{
"shelfmark": "test-shelfmark", # shelfmark is a required field,
"holding_institution": hinst.id, # holding institution is a required field
},
)

Expand Down

0 comments on commit 86d22c5

Please sign in to comment.