def test_InvalidLogo(self): form = ArtistProfileForm(data={'email': "*****@*****.**", 'name': "name", 'logo': "logo", 'description': "description_test1", 'artistNumber': 5}) user = Artist.objects.create_user(**self.register) formPhoto1 = PhotoForm(data={'url': "https://www.photo.com", 'id': user.id}) formPhoto2 = PhotoForm(data={'url': "https://www.photo2.com", 'id': user.id}) formTag1 = TagForm(data={'name': "nameTag1", 'id': user.id}) formTag2 = TagForm(data={'name': "nameTag2", 'id': user.id}) formMedia1 = MediaForm(data={'url': "https://www.youtube.com", 'id': user.id}) formMedia2 = MediaForm(data={'url': "https://www.youtube.com", 'id': user.id}) self.assertFalse(form.is_valid()) self.assertTrue(formPhoto1.is_valid()) self.assertTrue(formPhoto2.is_valid()) self.assertTrue(formTag1.is_valid()) self.assertTrue(formTag2.is_valid()) self.assertTrue(formMedia1.is_valid()) self.assertTrue(formMedia2.is_valid())
def test_NoName(self): form = VenueProfileForm( data={ 'email': "*****@*****.**", 'name': "", 'logo': "www.urlexample.es", 'description': "this is a description", 'address': "addresstest", 'capacity': 10 }) user = Venue.objects.create_user(**self.register) formPhoto1 = PhotoForm(data={ 'url': "https://www.photo.com", 'id': user.id }) formPhoto2 = PhotoForm(data={ 'url': "https://www.photo2.com", 'id': user.id }) self.assertFalse(form.is_valid()) self.assertTrue(formPhoto1.is_valid()) self.assertTrue(formPhoto2.is_valid())