Skip to content
This repository was archived by the owner on Jun 30, 2024. It is now read-only.

Commit bdf5831

Browse files
committed
Update tests pass with child course
1 parent d078f28 commit bdf5831

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

tests/test_admin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ def test_copy_assignment(assign_id, test_assignment, test_client, test_user_1, r
204204
assign_id = my_ass.assignment_id
205205
res = test_client.validate('admin/copy_assignment', data=dict(
206206
oldassignment=assign_id,
207-
course='test_course_1'
207+
course='test_child_course_1'
208208
))
209209
assert res == "success"
210210

tests/test_ajax2.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,7 @@ def test_GetCompletionStatus(test_client, test_user_1, runestone_db_tools):
659659

660660
# Check an unviewed page
661661
kwargs = dict(
662-
lastPageUrl = 'https://runestone.academy/runestone/static/test_course_1/test_chapter_1/toctree.html'
662+
lastPageUrl = 'https://runestone.academy/runestone/books/published/test_course_1/test_chapter_1/subchapter_a.html'
663663
)
664664

665665
test_client.validate('ajax/getCompletionStatus', data = kwargs)
@@ -669,7 +669,7 @@ def test_GetCompletionStatus(test_client, test_user_1, runestone_db_tools):
669669

670670
# check that the unviewed page gets added into the database with a start_date of today
671671
db = runestone_db_tools.db
672-
row = db((db.user_sub_chapter_progress.chapter_id == 'test_chapter_1') & (db.user_sub_chapter_progress.sub_chapter_id == 'toctree')).select().first()
672+
row = db((db.user_sub_chapter_progress.chapter_id == 'test_chapter_1') & (db.user_sub_chapter_progress.sub_chapter_id == 'subchapter_a')).select().first()
673673
print (row)
674674
assert row is not None
675675
assert row.end_date is None
@@ -681,7 +681,7 @@ def test_GetCompletionStatus(test_client, test_user_1, runestone_db_tools):
681681
# Check a viewed page w/ completion status 0
682682
# 'View the page'
683683
kwargs = dict(
684-
lastPageUrl = 'https://runestone.academy/runestone/static/test_course_1/test_chapter_1/subchapter_a.html',
684+
lastPageUrl = 'https://runestone.academy/runestone/books/published/test_course_1/test_chapter_1/subchapter_a.html',
685685
lastPageScrollLocation = 0,
686686
course = test_user_1.course.course_name,
687687
completionFlag = 0
@@ -715,13 +715,20 @@ def test_GetCompletionStatus(test_client, test_user_1, runestone_db_tools):
715715
test_client.validate('ajax/getAllCompletionStatus')
716716
res = json.loads(test_client.text)
717717
print(res)
718-
assert len(res) == 3
718+
assert len(res) == 1
719719

720720

721721
def test_updatelastpage(test_client, test_user_1, runestone_db_tools):
722+
# Check an unviewed page
723+
kwargs = dict(
724+
lastPageUrl = 'https://runestone.academy/runestone/books/published/test_course_1/test_chapter_1/subchapter_a.html'
725+
)
726+
727+
test_client.validate('ajax/getCompletionStatus', data = kwargs)
728+
722729
test_user_1.login()
723730
kwargs = dict(
724-
lastPageUrl = 'https://runestone.academy/runestone/static/test_course_1/test_chapter_1/subchapter_a.html',
731+
lastPageUrl = 'https://runestone.academy/runestone/books/published/test_course_1/test_chapter_1/subchapter_a.html',
725732
lastPageScrollLocation = 0,
726733
course = test_user_1.course.course_name,
727734
completionFlag = 1

0 commit comments

Comments
 (0)