You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have gotten this working and am very grateful for your work, well done!
Something that I think needs to be done is the addition of testing. Could you add an example of how to go about using the Django testing framework to create user and login.
The part I get stuck at is that when I go to login(using the testing, I get the index.html page back and not the aceess and refresh token.
I have two functions:
def setUp(self):
try:
response = self.client.post('/user/create/', {"username":TEST_USER_LOGIN_NAME, "password":TEST_USER_LOGIN_PASSWORD, "email":TEST_USER_LOGIN_EMAIL}, format="json")
except:
print("Error occured while creating the user login")
and
def test_GetListProducts(self):
response = self.client.post("/token/obtain/", {"username":TEST_USER_LOGIN_NAME, "password":TEST_USER_LOGIN_PASSWORD}, format="json")
# print(response) <-- This gives me back the index.html instead of the response with access and refresh tokens
#self.client.credentials(HTTP_AUTHORIZATION='Token ' + response.data['access'])
response = self.client.get('productss/')
self.assertEqual(status.HTTP_200_OK, response.status_code)
self.assertEqual(True, True)
any help would be greatly appreciated. Or if you want to put up your own example it would be helpful too
The text was updated successfully, but these errors were encountered:
Hi,
I have gotten this working and am very grateful for your work, well done!
Something that I think needs to be done is the addition of testing. Could you add an example of how to go about using the Django testing framework to create user and login.
The part I get stuck at is that when I go to login(using the testing, I get the index.html page back and not the aceess and refresh token.
I have two functions:
and
any help would be greatly appreciated. Or if you want to put up your own example it would be helpful too
The text was updated successfully, but these errors were encountered: