Skip to content

Commit

Permalink
fix(tests): Remove segment from Chant view tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dchiller committed Jun 18, 2024
1 parent 6807731 commit 8361d23
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions django/cantusdb_project/main_app/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -3148,14 +3148,12 @@ def test_url_and_templates(self):

def test_create_chant(self):
source = make_fake_source()
segment = make_fake_segment()
response = self.client.post(
reverse("chant-create", args=[source.id]),
{
"manuscript_full_text_std_spelling": "initial",
"folio": "001r",
"c_sequence": "1",
"segment": segment.id,
},
)
self.assertEqual(response.status_code, 302)
Expand Down Expand Up @@ -3207,14 +3205,12 @@ def test_repeated_seq(self):
TEST_FOLIO = "001r"
# create some chants in the test source
source = make_fake_source()
segment = make_fake_segment()
for i in range(1, 5):
Chant.objects.create(
source=source,
manuscript_full_text=faker.text(10),
folio=TEST_FOLIO,
c_sequence=i,
segment=segment,
)
# post a chant with the same folio and seq
url = reverse("chant-create", args=[source.id])
Expand All @@ -3225,7 +3221,6 @@ def test_repeated_seq(self):
"manuscript_full_text_std_spelling": fake_text,
"folio": TEST_FOLIO,
"c_sequence": random.randint(1, 4),
"segment": segment.id,
},
follow=True,
)
Expand Down Expand Up @@ -3254,7 +3249,6 @@ def test_template_used(self):

def test_volpiano_signal(self):
source = make_fake_source()
segment = make_fake_segment()
self.client.post(
reverse("chant-create", args=[source.id]),
{
Expand All @@ -3266,7 +3260,6 @@ def test_volpiano_signal(self):
"volpiano": "9abcdefg)A-B1C2D3E4F5G67?. yiz",
# ^ ^ ^ ^ ^ ^ ^^^^^^^^
# clefs, accidentals, etc., to be deleted
"segment": segment.id,
},
)
with patch("requests.get", mock_requests_get):
Expand All @@ -3282,7 +3275,6 @@ def test_volpiano_signal(self):
"folio": "001r",
"c_sequence": "2",
"volpiano": "abacadaeafagahaja",
"segment": segment.id,
},
)
with patch("requests.get", mock_requests_get):
Expand All @@ -3300,7 +3292,6 @@ def test_initial_values(self):
feast: Feast = make_fake_feast()
office: Office = make_fake_office()
image_link: str = "https://www.youtube.com/watch?v=9bZkp7q19f0"
segment = make_fake_segment()
self.client.post(
reverse("chant-create", args=[source.id]),
{
Expand All @@ -3310,7 +3301,6 @@ def test_initial_values(self):
"feast": feast.id,
"office": office.id,
"image_link": image_link,
"segment": segment.id,
},
)
with patch("requests.get", mock_requests_get):
Expand Down Expand Up @@ -3478,15 +3468,13 @@ def test_update_chant(self):

folio = chant.folio
c_sequence = chant.c_sequence
segment_id = chant.segment_id
response = self.client.post(
reverse("source-edit-chants", args=[source.id]),
{
"manuscript_full_text_std_spelling": "test",
"pk": chant.id,
"folio": folio,
"c_sequence": c_sequence,
"segment": segment_id,
},
)
self.assertEqual(response.status_code, 302)
Expand All @@ -3496,14 +3484,12 @@ def test_update_chant(self):
self.assertEqual(chant.manuscript_full_text_std_spelling, "test")

def test_volpiano_signal(self):
segment = make_fake_segment()
source = make_fake_source()
chant_1 = make_fake_chant(
manuscript_full_text_std_spelling="ut queant lactose",
source=source,
folio="001r",
c_sequence=1,
segment=segment,
)
self.client.post(
reverse("source-edit-chants", args=[source.id]),
Expand All @@ -3516,7 +3502,6 @@ def test_volpiano_signal(self):
"volpiano": "9abcdefg)A-B1C2D3E4F5G67?. yiz",
# ^ ^ ^ ^ ^ ^ ^^^^^^^^
# clefs, accidentals, etc., to be deleted
"segment": segment.id,
},
)
chant_1 = Chant.objects.get(
Expand All @@ -3530,7 +3515,6 @@ def test_volpiano_signal(self):
source=source,
folio="001r",
c_sequence=2,
segment=segment,
)
expected_volpiano: str = "abacadaeafagahaja"
expected_intervals: str = "1-12-23-34-45-56-67-78-8"
Expand All @@ -3541,7 +3525,6 @@ def test_volpiano_signal(self):
"folio": "001r",
"c_sequence": "2",
"volpiano": "abacadaeafagahaja",
"segment": segment.id,
},
)
with patch("requests.get", mock_requests_get):
Expand Down Expand Up @@ -3595,7 +3578,6 @@ def test_proofread_chant(self):
"folio": folio,
"c_sequence": c_sequence,
"manuscript_full_text_std_spelling": ms_std,
"segment": chant.segment_id,
},
)
self.assertEqual(response.status_code, 302) # 302 Found
Expand Down

0 comments on commit 8361d23

Please sign in to comment.