def salle(self): self.salles=[] CAPACITE=[100, None] if self.alll: TYPE=[x[0] for x in SALLES] else: TYPE=[SALLES[1][0]] TYPE.append(None) nom="1" for typee in TYPE: for capa in CAPACITE: repo=addSalle(self.puser, nom, capacite=capa, typee=typee) nom=nom+"1" self.assertFalse(type(repo) is str) self.salles.append(repo) repo=addSalle(self.puser, "1") self.assertTrue(type(repo) is str)
def save(self): data = self.cleaned_data nom = data['nom'] capacite = data['capacite'] typee = data['type'] addData.addSalle(nom, capacite, typee)