-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: students levels are not shared with anybody when the student is …
…dismissed
- Loading branch information
Seb Palmer
committed
Oct 31, 2024
1 parent
ec52caa
commit 9ef702c
Showing
2 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -252,11 +252,24 @@ def test_release_verified_student(self): | |
assert response.status_code == 302 | ||
|
||
student = Student.objects.get(pk=self.student.pk) | ||
|
||
assert student.user.is_verified | ||
|
||
c.logout() | ||
c.login(username=self.email, password=self.password) | ||
|
||
teacher = Teacher.objects.factory("the", "teacher", "[email protected]", "password") | ||
level = Level.objects.create() | ||
|
||
level.owner = student.new_user.userprofile | ||
level.shared_with.add(teacher.new_user) | ||
level.save() | ||
|
||
students_levels = Level.objects.filter(owner=student.new_user.userprofile).all() | ||
|
||
for level in students_levels.all(): | ||
assert level.shared_with.exists() | ||
|
||
release_url = reverse( | ||
"teacher_dismiss_students", args=[self.class_access_code] | ||
) | ||
|
@@ -279,6 +292,11 @@ def test_release_verified_student(self): | |
student = Student.objects.get(pk=self.student.pk) | ||
assert not student.user.is_verified | ||
|
||
students_levels = Level.objects.filter(owner=student.new_user.userprofile).all() | ||
|
||
for level in students_levels.all(): | ||
assert not level.shared_with.exists() | ||
|
||
|
||
class TestLoginViews(TestCase): | ||
@classmethod | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters