Skip to content

Commit

Permalink
Merge branch 'develop' into fixed-1508-siglum-2
Browse files Browse the repository at this point in the history
  • Loading branch information
dchiller committed Jun 13, 2024
2 parents bd22850 + 6266757 commit e48c6c3
Show file tree
Hide file tree
Showing 5 changed files with 116 additions and 85 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/django_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: django-tests
on:
pull_request:
types: [opened, synchronize]
jobs:
run-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: mkdir -p config/envs
- uses: SpicyPizza/[email protected]
with:
envkey_POSTGRES_DB: test_cantusdb
envkey_POSTGRES_USER: test_user
envkey_POSTGRES_HOST: postgres
envkey_POSTGRES_PORT: 5432
envkey_PROJECT_ENVIRONMENT: PRODUCTION
envkey_CANTUSDB_STATIC_ROOT: /path/to/static
envkey_CANTUSDB_MEDIA_ROOT: /path/to/media
envkey_CANTUSDB_HOST: somehost
envkey_CANTUSDB_SECRET_KEY: "hereisakey1234"
envkey_POSTGRES_PASSWORD: woahagreatpasswordabc
envkey_AWS_EMAIL_HOST_USER: test_user
envkey_AWS_EMAIL_HOST_PASSWORD: test_password
directory: config/envs
file_name: dev_env
- run: docker compose -f docker-compose-development.yml build
- run: docker compose -f docker-compose-development.yml up -d
- run: docker compose -f docker-compose-development.yml exec -T django python manage.py test main_app.tests
4 changes: 2 additions & 2 deletions django/cantusdb_project/main_app/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -3642,11 +3642,11 @@ def test_edit_syllabification(self):
self.assertEqual(chant.manuscript_syllabized_full_text, "lorem ipsum")
response = self.client.post(
f"/edit-syllabification/{chant.id}",
{"manuscript_syllabized_full_text": "lo-rem ip-sum"},
{"manuscript_syllabized_full_text": "lore-m i-psum"},
)
self.assertEqual(response.status_code, 302) # 302 Found
chant.refresh_from_db()
self.assertEqual(chant.manuscript_syllabized_full_text, "lo-rem ip-sum")
self.assertEqual(chant.manuscript_syllabized_full_text, "lore-m i-psum")


class FeastListViewTest(TestCase):
Expand Down
2 changes: 1 addition & 1 deletion django/cantusdb_project/main_app/views/chant.py
Original file line number Diff line number Diff line change
Expand Up @@ -1193,7 +1193,7 @@ def get_initial(self):
initial = super().get_initial()
chant = self.get_object()
has_syl_text = bool(chant.manuscript_syllabized_full_text)
syls_text = syllabify_text(
syls_text, _ = syllabify_text(
text=chant.get_best_text_for_syllabizing(),
clean_text=True,
text_presyllabified=has_syl_text,
Expand Down
Loading

0 comments on commit e48c6c3

Please sign in to comment.