Exemple #1
0
 def setUp(self):
     self.factory = APIRequestFactory()
     self.url = reverse('api:user_api')
     self.client = ApplicationFactory.create()
     self.user_data = {
         'display_name': 'user 1',
         'email': '*****@*****.**',
         'password1': '123456',
         'password2': '123456'
     }
     self.data = self.user_data.copy()
     self.data['client_id'] = self.client.client_id
Exemple #2
0
 def setUp(self):
     self.factory = APIRequestFactory()
     self.url = reverse('api:user_api')
     self.client = ApplicationFactory.create()
     self.user_data = {
         'display_name': 'user 1',
         'email': '*****@*****.**',
         'password1': '123456',
         'password2': '123456'
     }
     self.data = self.user_data.copy()
     self.data['client_id'] = self.client.client_id
Exemple #3
0
    def test_reset_password(self):
        user = UserF.create()
        app = ApplicationFactory.create()
        AccessToken.objects.create(
            user=user,
            application=app,
            token='df0af6a395b4cd072445b3832e9379bfee257da0',
            scope=1,
            expires='2030-12-31 23:59')

        user.reset_password('123456')

        self.assertEqual(0, AccessToken.objects.filter(user=user).count())
Exemple #4
0
    def test_reset_password(self):
        user = UserF.create()
        app = ApplicationFactory.create()
        AccessToken.objects.create(
            user=user,
            application=app,
            token='df0af6a395b4cd072445b3832e9379bfee257da0',
            scope=1,
            expires='2030-12-31T23:59:00+00:00'
        )

        user.reset_password('123456')

        self.assertEqual(0, AccessToken.objects.filter(user=user).count())