def test_get_case(self): '''test incomplete''' cohort = CohortFactory() case = CaseFactory() case.cohort.add(cohort) self.assertIsNotNone(cohort.case) self.assertTrue(case, cohort.case)
def test_usernames(self): cohort = CohortFactory() facil = FacilitatorUpFactory(cohort=cohort) grp1 = GroupUpFactory(cohort=cohort) grp2 = GroupUpFactory(cohort=cohort) self.assertTrue(facil.user.username in cohort.usernames()) self.assertTrue(grp1.user.username in cohort.usernames()) self.assertTrue(grp2.user.username in cohort.usernames())
class CohortTest(TestCase): def test_unicode(self): case = CaseFactory() cohort = CohortFactory() case.cohort.add(cohort) self.assertEqual(cohort.display_name(), cohort.name) self.assertTrue(str(cohort).startswith("cohort "))
def test_edit_form(self): cohort = CohortFactory() case = CaseFactory() case.cohort.add(cohort) edit_form = cohort.edit_form() self.assertTrue('name' in edit_form.fields)
def test_add_form(self): add_form = CohortFactory().add_form() self.assertTrue('name' in add_form.fields)
def test_edit_form(self): edit_form = FacilitatorUpFactory(cohort=CohortFactory()).edit_form() self.assertTrue('username' in edit_form.fields) self.assertTrue('profile_type' in edit_form.fields) self.assertTrue('cohort' in edit_form.fields)
def test_get_users(self): i = LibraryItemFactory() cohort = CohortFactory() self.assertEqual(len(i.get_users(cohort)), 0)