def test_enrolled_in_localized(self): """localized should include baseline but not indefinite""" self.bless_with_basics() self.mark_localized() user = db.session.merge(self.test_user) a_s = AssessmentStatus(user=user) self.assertTrue(a_s.enrolled_in_classification('baseline')) self.assertFalse(a_s.enrolled_in_classification('indefinite'))
def test_enrolled_in_metastatic(self): """metastatic should include baseline and indefinite""" self.bless_with_basics() self.mark_metastatic() user = db.session.merge(self.test_user) a_s = AssessmentStatus(user=user) self.assertTrue(a_s.enrolled_in_classification('baseline')) self.assertTrue(a_s.enrolled_in_classification('indefinite'))
def test_metastatic_overdue(self): # if the user completed something on time, and nothing else # is due, should see the thankyou message. # backdate so the baseline q's have expired mock_qr(user_id=TEST_USER_ID, instrument_id='epic26', status='in-progress') self.bless_with_basics(backdate=timedelta(days=31)) self.mark_metastatic() self.test_user = db.session.merge(self.test_user) a_s = AssessmentStatus(user=self.test_user) self.assertEquals(a_s.overall_status, "Partially Completed") # with all q's from baseline expired, # instruments_needing_full_assessment and insturments_in_progress # should be empty self.assertFalse(a_s.instruments_needing_full_assessment('baseline')) self.assertFalse(a_s.instruments_in_progress('baseline')) # mock completing the indefinite QB and expect to see 'thank you' mock_qr(user_id=TEST_USER_ID, instrument_id='irondemog') self.test_user = db.session.merge(self.test_user) a_s = AssessmentStatus(user=self.test_user) self.assertTrue(a_s.enrolled_in_classification('indefinite')) self.assertFalse(a_s.instruments_needing_full_assessment('indefinite')) self.assertFalse(a_s.instruments_in_progress('indefinite'))