def test_SearchTwoFields(self): personas = Persona.search ('Espa Tene') self.assertEqual (personas[0], Persona.objects.get (pk = 2)) self.assertEqual (1, len (personas))
def test_SearchTel(self): personas = Persona.search ('922123456') self.assertEqual (personas[0], Persona.objects.get (pk = 1)) self.assertEqual (1, len (personas))
def test_SearchPlaceOfBirth(self): personas = Persona.search ('Tenerife') self.assertEqual (personas[0], Persona.objects.get (pk = 2)) self.assertEqual (1, len (personas))
def test_SearchNation(self): personas = Persona.search ('Espa') self.assertEqual (personas[0], Persona.objects.get (pk = 1)) self.assertEqual (personas[1], Persona.objects.get (pk = 2)) self.assertEqual (2, len (personas))
def test_SearchIDDocument(self): personas = Persona.search ('123123123J') self.assertEqual (personas[0], Persona.objects.get (pk = 1)) self.assertEqual (1, len (personas))
def test_SearchSurname(self): personas = Persona.search ('apellido') self.assertEqual (personas[0], Persona.objects.get (pk = 1)) self.assertEqual (personas[1], Persona.objects.get (pk = 2)) self.assertEqual (2, len (personas))
def test_SearchName(self): personas = Persona.search ('profesor1') self.assertEqual (personas[0], Persona.objects.get (pk = 1)) self.assertEqual (1, len (personas))