Exemplo n.º 1
0
 def test_registerWithPseudonymAsRegisteredRealName(self):
     data = self.form_data.copy()
     with open('fixtures/image1.jpg', 'rb') as img:
         data['file'] = SimpleUploadedFile(img.name, img.read())
     data['username'] = '******'
     form = RegistrationForm(data=data)
     self.assertFalse(form.is_valid())
Exemplo n.º 2
0
 def test_registerAlreadyTakenNickname(self):
     data = self.form_data.copy()
     with open('fixtures/image1.jpg', 'rb') as img:
         data['file'] = SimpleUploadedFile(img.name, img.read())
     data['username'] = '******'
     form = RegistrationForm(data=data)
     self.assertFalse(form.is_valid())
Exemplo n.º 3
0
 def test_registerWithEmptyUsername(self):
     data = self.form_data.copy()
     data['username'] = None
     form = RegistrationForm(data=data)
     self.assertTrue(form.is_valid())
Exemplo n.º 4
0
 def test_notMatchingPasswords(self):
     data = self.form_data.copy()
     data['password1'] = 'test1'
     form = RegistrationForm(data=data)
     self.assertFalse(form.is_valid())
Exemplo n.º 5
0
 def test_invalidMailAddress(self):
     data = self.form_data.copy()
     data['email'] = 'test'
     form = RegistrationForm(data=data)
     self.assertFalse(form.is_valid())
Exemplo n.º 6
0
 def test_validRegistrationWithAcceptableProfileImage(self):
     data = self.form_data.copy()
     with open('fixtures/image1.jpg', 'rb') as img:
         data['file'] = SimpleUploadedFile(img.name, img.read())
     form = RegistrationForm(data=data)
     self.assertTrue(form.is_valid())