Exemple #1
0
 def test_mail_sent_successfully(self):
     """Tests whether the confirmation email was sent successfully"""
     self.create_default_role(role_name="Master Admin")
     response = self.query(register_user_query.format(**self.user_data), )
     self.assertEqual(len(mail.outbox), 1)
     self.assertIn('success', response['data']['createUser'])
Exemple #2
0
 def test_register_mutation_user_error(self):
     """user with the same email already exists"""
     response = self.query(register_user_query.format(**self.user_data), )
     response = self.query(register_user_query.format(**self.user_data), )
     self.assertIn('errors', response['data']['createUser'])
Exemple #3
0
 def test_create_wrong_email(self):
     """tests invalid email adress"""
     self.user_data['email'] = 'usergmail.com'
     response = self.query(register_user_query.format(**self.user_data), )
     self.assertIn('errors', response)
     self.assertNotIn('success', response)
Exemple #4
0
 def test_create_wrong_mobileNumber(self):
     """tests invalid mobile number"""
     self.user_data['mobileNumber'] = '2345'
     response = self.query(register_user_query.format(**self.user_data), )
     self.assertIn('errors', response)
     self.assertNotIn('success', response)
Exemple #5
0
 def test_create_wrong_password(self):
     """tests for a weak password"""
     self.user_data['password'] = '******'
     response = self.query(register_user_query.format(**self.user_data), )
     self.assertIn('errors', response)
     self.assertNotIn('success', response)
Exemple #6
0
 def test_create_user(self):
     """method for creating a user"""
     response = self.query(register_user_query.format(**self.user_data), )
     self.assertNotIn('errors', response)
     self.assertIn('success', response['data']['createUser'])