Exemplo n.º 1
0
 def test_update_user_name(self):
     new_user_name = common.unique_str()
     new_user_email = common.unique_email()
     self.update_user(self.user['id'], user_name=new_user_name,
         user_email=new_user_email)
     r = self.fetch_user(self.user['id'])
     self.assertTrue(r.json['user']['name'], new_user_name)
Exemplo n.º 2
0
 def test_update_user_name(self):
     new_user_name = common.unique_str()
     new_user_email = common.unique_email()
     self.update_user(self.user['id'], user_name=new_user_name,
         user_email=new_user_email)
     r = self.fetch_user(self.user['id'])
     self.assertTrue(r.json['user']['name'], new_user_name)
Exemplo n.º 3
0
 def test_create_users_with_duplicate_emails(self):
     email = common.unique_email()
     self.create_user(user_email=email)
     self.create_user(user_email=email, assert_status=409)
Exemplo n.º 4
0
 def test_update_user_disabled_token(self):
     self.admin_token = self.disabled_admin_token
     self.update_user(self.user['id'], user_email=common.unique_email(),
         assert_status=403)
Exemplo n.º 5
0
 def test_update_user_bad_request(self):
     data = '{"user_bad": { "bad": "%s"}}' % (common.unique_email(),)
     self.post_user_for_update(
         self.user['id'], assert_status=400, body=data, headers={
         "Content-Type": "application/json"})
Exemplo n.º 6
0
 def test_create_users_with_duplicate_emails(self):
     email = common.unique_email()
     self.create_user(user_email=email)
     self.create_user(user_email=email, assert_status=409)
Exemplo n.º 7
0
 def test_update_user_disabled_token(self):
     self.admin_token = self.disabled_admin_token
     self.update_user(self.user['id'], user_email=common.unique_email(),
         assert_status=403)
Exemplo n.º 8
0
 def test_update_user_bad_request(self):
     data = '{"user_bad": { "bad": "%s"}}' % (common.unique_email(),)
     self.put_user(self.user['id'], assert_status=400, body=data, headers={
         "Content-Type": "application/json"})
Exemplo n.º 9
0
 def test_update_user_email(self):
     new_user_email = common.unique_email()
     self.update_user(self.user['id'], user_email=new_user_email)
     r = self.fetch_user(self.user['id'])
     self.assertTrue(r.json['user']['email'], new_user_email)