-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c4bfdf3
commit 0fd97b9
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,36 @@ | ||
import requests | ||
|
||
from django.test import TestCase | ||
from rest_framework import status | ||
from rest_framework.test import RequestsClient | ||
|
||
# Create your tests here. | ||
class AuthTests(TestCase): | ||
|
||
def setup(self): | ||
self.client = RequestsClient() | ||
|
||
def test_register(self): | ||
data = { | ||
'email': '[email protected]', | ||
'username': 'testUser', | ||
'password': 'testPassword' | ||
} | ||
response = self.client.post('/_allauth/app/v1/auth/signup',data=data) | ||
print(response.content) | ||
self.assertEqual(response.status_code, status.HTTP_200_OK) | ||
|
||
#can register a user, user is w/in User model | ||
# user is logged in after registration | ||
# logged-in user can create Data, is data's current_user | ||
# test log out | ||
|
||
|
||
# Permissions | ||
# Any user can access public data | ||
# logged-in user can access and modify their own private data | ||
# unauthenticated user cannot access private data | ||
# unauthenticated user cannot modify data | ||
# logged-in user cannot modify data other than their own | ||
# logged-in user cannot access the private data of others | ||
|