Navigation

    SOFTWARE TESTING

    • Register
    • Login
    • Search
    • Job Openings
    • Freelance Jobs
    • Services
    • Conferences
    • Courses
    1. Home
    2. Alberto
    3. Best
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    Best posts made by Alberto

    • Test for Django REST API framework

      There is my functional test

      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)
      

      When passing this test, error 400 appears. Can you please tell me how to access the response content from response?

      posted in API Testing
      Alberto
      Alberto
    • RE: What tool do you use for Rest API testing?

      POSTMAN, Soap UI are the best

      posted in API Testing
      Alberto
      Alberto
    • 1 / 1