Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API Test Case issue (Response Content-Type) with Solution #14

Open
SnowLLL opened this issue Apr 21, 2021 · 0 comments
Open

API Test Case issue (Response Content-Type) with Solution #14

SnowLLL opened this issue Apr 21, 2021 · 0 comments

Comments

@SnowLLL
Copy link

SnowLLL commented Apr 21, 2021

def test_follow_api_endpoint(self): client = self.get_client() response = client.post(f'/api/profiles/{self.userb.username}/follow', {'action': 'follow'}) count = response.json().get('count') self.assertEqual(count, 1)

Response Content-Type is returned as text/html instead of application/json

Solution:

response = client.post(f'/api/profiles/{self.userb.username}/follow',
{'action': 'follow'}, format='json')

@SnowLLL SnowLLL changed the title API Test Case issue - Response Content-Type API Test Case issue (Response Content-Type) with Solution Apr 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant