Skip to content

Commit

Permalink
increase test coverage by adding test case for test run
Browse files Browse the repository at this point in the history
  • Loading branch information
Redflashx12 committed Nov 4, 2024
1 parent 0a33410 commit 5f10109
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions evap/staff/tests/test_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,23 @@ def test_do_not_remove_user_due_to_inactivity(self):
self.assertFalse(active_user.can_be_marked_inactive_by_manager)
self.assertEqual(len(messages), 0)

def test_do_nothing_if_test_run(self):
inactive_user = baker.make(UserProfile, last_name="Test Run User")
inactive_evaluation = baker.make(
Evaluation,
state=Evaluation.State.PUBLISHED,
vote_start_datetime=datetime.today()
- timedelta(days=settings.PARTICIPATION_DELETION_AFTER_INACTIVE_MONTHS + 1),
vote_end_date=datetime.today() - timedelta(days=settings.PARTICIPATION_DELETION_AFTER_INACTIVE_MONTHS + 1),
participants=[inactive_user],
)

inactive_evaluation.course.semester.archive()

messages = remove_inactive_participations(inactive_user, test_run=True)
self.assertTrue(inactive_user.can_be_marked_inactive_by_manager)
self.assertEqual(len(messages), 1)


class UserEditLinkTest(TestCase):
def test_user_edit_link(self):
Expand Down

0 comments on commit 5f10109

Please sign in to comment.