@@ -0,0 +1,2478 @@
+import unittest%0Aimport mock%0Afrom ...authentication.database import Database%0A%0A%0Aclass TestDatabase(unittest.TestCase):%0A%0A    @mock.patch('auth0.v2.authentication.database.Database.post')%0A    def test_login(self, mock_post):%0A%0A        d = Database('my.domain.com')%0A%0A        d.login(client_id='cid',%0A                username='usrnm',%0A                password='pswd',%0A                id_token='idt',%0A                connection='conn',%0A                device='dev',%0A                grant_type='gt')%0A%0A        args, kwargs = mock_post.call_args%0A%0A        self.assertEqual(args%5B0%5D, 'https://my.domain.com/oauth/ro')%0A        self.assertEqual(kwargs%5B'data'%5D, %7B%0A            'client_id': 'cid',%0A            'username': 'usrnm',%0A            'password': 'pswd',%0A            'id_token': 'idt',%0A            'connection': 'conn',%0A            'device': 'dev',%0A            'grant_type': 'gt',%0A            'scope': 'openid',%0A        %7D)%0A        self.assertEqual(kwargs%5B'headers'%5D, %7B%0A            'Content-Type': 'application/json'%0A        %7D)%0A%0A    @mock.patch('auth0.v2.authentication.database.Database.post')%0A    def test_signup(self, mock_post):%0A%0A        d = Database('my.domain.com')%0A%0A        d.signup(client_id='cid',%0A                 email='a@b.com',%0A                 password='pswd',%0A                 connection='conn')%0A%0A        args, kwargs = mock_post.call_args%0A%0A        self.assertEqual(args%5B0%5D, 'https://my.domain.com/dbconnections/signup')%0A        self.assertEqual(kwargs%5B'data'%5D, %7B%0A             'client_id': 'cid',%0A             'email': 'a@b.com',%0A             'password': 'pswd',%0A             'connection': 'conn',%0A        %7D)%0A        self.assertEqual(kwargs%5B'headers'%5D, %7B%0A            'Content-Type': 'application/json'%0A        %7D)%0A%0A    @mock.patch('auth0.v2.authentication.database.Database.post')%0A    def test_change_password(self, mock_post):%0A%0A        d = Database('my.domain.com')%0A%0A        d.change_password(client_id='cid',%0A                          email='a@b.com',%0A                          password='pswd',%0A                          connection='conn')%0A%0A        args, kwargs = mock_post.call_args%0A%0A        self.assertEqual(args%5B0%5D,%0A            'https://my.domain.com/dbconnections/change_password')%0A        self.assertEqual(kwargs%5B'data'%5D, %7B%0A            'client_id': 'cid',%0A            'email': 'a@b.com',%0A            'password': 'pswd',%0A            'connection': 'conn',%0A        %7D)%0A        self.assertEqual(kwargs%5B'headers'%5D, %7B%0A            'Content-Type': 'application/json'%0A        %7D)%0A

Add Database tests