def setUpClass(cls): # Launch Selenium cls.driver = util.launch_driver() # Generate user data cls.user_data = util.gen_user_data()
def test_email_mismatch(self): # Alter form data form_data = util.gen_user_data() form_data['username2'] = form_data['username2'] + 'junk' # Submit form self._submit_and_check(form_data, 'email addresses must match')
def test_password_mismatch(self): # Alter form data form_data = util.gen_user_data() form_data['password2'] = form_data['password2'] + 'junk' # Submit form self._submit_and_check(form_data, 'passwords must match')
def test_no_email(self): # Alter form data form_data = util.gen_user_data() form_data['username'] = '' # Submit form self._submit_and_check(form_data, 'email address is required')
def test_no_password(self): # Alter form data form_data = util.gen_user_data() form_data['password'] = '' # Submit form self._submit_and_check(form_data, 'password is required')
def test_invalid_email(self): # Alter form data form_data = util.gen_user_data() form_data['username'] = '******' # Submit form self._submit_and_check(form_data, 'email address is invalid')
def test_short_password(self): # Alter form data form_data = util.gen_user_data() form_data['password'] = '******' # Submit form self._submit_and_check(form_data, 'password is too short')
def setUp(self): # Call parent setUp super(UserCreationTests, self).setUp() # Generate user data self.user_data = util.gen_user_data() # Browse to account creation page self.driver.get('%s/account' % (config.osf_home))
def test_long_password(self): # Alter form data form_data = util.gen_user_data() password = '******' * 50 form_data['password'] = password form_data['password2'] = password # Submit form self._submit_and_check(form_data, 'password is too long')