Ejemplo n.º 1
0
 def setUp(self):
     patch1 = mock.patch('auth0plus.management.users.User._client')
     self.client = patch1.start()
     self.usr = User(email='axl@äcdc.com', email_verified=True, user_id='1')
     self.usr._fetched = True
     self.usr._original.update(self.usr.as_dict())
     self.addCleanup(mock.patch.stopall)
Ejemplo n.º 2
0
 def setUp(self):
     patch1 = mock.patch(
         'auth0plus.management.users.User.get',
         side_effect=User.DoesNotExist())
     patch2 = mock.patch(
         'auth0plus.management.users.User.create',
         return_value=User(id=1, email='bon@äcdc.com'))
     self.get = patch1.start()
     self.create = patch2.start()
     self.addCleanup(mock.patch.stopall)
Ejemplo n.º 3
0
 def test_save_new_user(self):
     usr = User(email='axl@äcdc.com', email_verified=True, password='******')
     usr.save()
     self.assertTrue(self.client.post.called)
     self.assertEqual(
         self.client.post.call_args[0][1],
         {
             'email': 'axl@äcdc.com',
             'password': '******',
             'email_verified': True,
             'connection': ''
         })
     self.assertTrue(usr._fetched)
     with self.assertRaises(AttributeError):
         usr.password
     self.assertEqual(
         usr.as_dict(),
         {'email': 'axl@äcdc.com', 'nickname': None, 'email_verified': True, 'user_id': '1'})
     self.assertEqual(usr.get_changed(), {})
Ejemplo n.º 4
0
 def test_get_id(self):
     user = User()
     user.get_id()
Ejemplo n.º 5
0
 def setUp(self):
     patch1 = mock.patch(
         'auth0plus.management.users.User.get',
         return_value=User(id=1, email='bon@äcdc.com'))
     self.get = patch1.start()
     self.addCleanup(mock.patch.stopall)