Exemplo n.º 1
0
 def test_get_case(self):
     '''test incomplete'''
     cohort = CohortFactory()
     case = CaseFactory()
     case.cohort.add(cohort)
     self.assertIsNotNone(cohort.case)
     self.assertTrue(case, cohort.case)
Exemplo n.º 2
0
 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())
Exemplo n.º 3
0
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 "))
Exemplo n.º 4
0
 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)
Exemplo n.º 5
0
 def test_add_form(self):
     add_form = CohortFactory().add_form()
     self.assertTrue('name' in add_form.fields)
Exemplo n.º 6
0
 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)
Exemplo n.º 7
0
 def test_get_users(self):
     i = LibraryItemFactory()
     cohort = CohortFactory()
     self.assertEqual(len(i.get_users(cohort)), 0)