Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from rest_framework import status
- from rest_framework.test import APITestCase
- __all__ = ['OAuthTestCase']
- ADDRESS_FOR_TEST = 'http://127.0.0.1:8000/api/v1/request/'
- class ApiOAuthTestCase(APITestCase):
- def setUp(self):
- User.objects.create_user(username=user_name, password=user_password)
- self.my_message = {
- 'grant_type': 'password',
- 'username': "user_name",
- 'password': "user_password",
- 'client_id': "secret_ket",
- 'client_secret': "clietn_id",
- }
- def test_token(self):
- response = self.client.post(ADDRESS_FOR_TEST, self.my_message)
- self.assertEqual(response.status_code, status.HTTP_201_CREATED)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement