def test_valid_form(self): "Submit valid data" # Submit valid data data = { 'email': '*****@*****.**', 'first_name': 'John', 'last_name': 'Smith', 'password': '******'} form = ProfileEditForm(data = data) self.assertTrue(form.is_valid())
def test_valid_form(self): "Submit valid data" # Submit valid data data = { 'email': '*****@*****.**', 'first_name': 'John', 'last_name': 'Smith', 'password': '******' } form = ProfileEditForm(data=data) self.assertTrue(form.is_valid())
def test_invalid_form(self): "Submit invalid data" # Submit no data form = ProfileEditForm() self.assertFalse(form.is_valid()) # Submit invalid data data = {'email': 'foo'} form = ProfileEditForm(data=data) self.assertFalse(form.is_valid()) # Submit existing data (email) data = {'email': '*****@*****.**'} form = ProfileEditForm(data=data) self.assertFalse(form.is_valid())
def test_invalid_form(self): "Submit invalid data" # Submit no data form = ProfileEditForm() self.assertFalse(form.is_valid()) # Submit invalid data data = { 'email': 'foo' } form = ProfileEditForm(data=data) self.assertFalse(form.is_valid()) # Submit existing data (email) data = { 'email': '*****@*****.**' } form = ProfileEditForm(data = data) self.assertFalse(form.is_valid())