I integrated OAuth into my Django app. OAuth has 2 steps:
- Redirect to OAuth provider domain name
- Callback to Django app with token
I would like to implement TestCase units for the above flow. Here is what I wrote for testing step 1:
def test_connect_with_oauth_provider(self):
"""Test connecting with OAuth provider."""
url = signin_url("oauth-provider")
res = self.client.get(url)
self.assertEqual(res.status_code, status.HTTP_200_OK)
However, the test uses testcase domain not my real domain and thus the test fails. Can you please help me implement tests for both steps? Thanks!