Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

JoaquinAcuna97

🏠
Working from home
View GitHub Profile
View CORS_settings.py
INSTALLED_APPS = (
...
'corsheaders',
...
)
MIDDLEWARE_CLASSES = (
...
'corsheaders.middleware.CorsMiddleware',
'django.middleware.common.CommonMiddleware',
View check_register.graphql
query {
users (last: 1){
edges {
node {
id,
username,
email,
isActive,
archived,
verified,
View register_correct.graphql
mutation {
register(
email: "new_user@email.com",
username: "new_user",
password1: "supersecretpassword",
password2: "supersecretpassword",
) {
success,
errors,
token,
View register.graphql
mutation {
register(
email: "new_user@email.com",
username: "new_user",
password1: "123456",
password2: "123456",
) {
success,
errors,
token,
View GRAPHQL_JWT.py
GRAPHQL_JWT = {
#...
"JWT_ALLOW_ANY_CLASSES": [
"graphql_auth.mutations.Register",
],
}
View test_example.py
from selenium import webdriver
import unittest
class HomePageTest(unittest.TestCase):
def setUp(self):
self.driver = webdriver.Firefox(
)
def test_home_page(self):
self.driver.get("http://127.0.0.1:8000/")