def typeCour(self): EXAM = [None, True, False] PROF = [None, [self.puser], [self.puser, choice(self.listpers)]] noms = "a" self.typecours = [] for exa in EXAM: for prof in PROF: repo = addCour(self.puser, noms, isExam=exa, profs=prof) self.assertFalse(type(repo) is str) self.typecours.append(repo) noms = noms + "a" repo = addCour(self.puser, "a") self.assertTrue(type(repo) is str)
def save(self): data = self.cleaned_data nom = data['nom'] isExam = data['isExam'] addData.addCour(nom, isExam)