From 0694471270e28e47fb5d0af1528f310d616eaec5 Mon Sep 17 00:00:00 2001 From: Christian Cueni Date: Tue, 8 Oct 2019 11:24:54 +0200 Subject: [PATCH] =?UTF-8?q?Fix=20test,=20cleanup=20=F0=9F=9B=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/cypress/integration/change-password-spec.js | 2 +- client/src/main.js | 1 - server/core/settings_test.py | 1 + server/core/static/styles/main.scss | 2 -- server/core/tests/test_api.py | 5 ++++- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/client/cypress/integration/change-password-spec.js b/client/cypress/integration/change-password-spec.js index 726267f4..708cb27d 100644 --- a/client/cypress/integration/change-password-spec.js +++ b/client/cypress/integration/change-password-spec.js @@ -7,7 +7,7 @@ describe('Change Password Page', () => { const validationOldWrongMsg = 'Die Eingabe ist falsch'; beforeEach(function () { - // cy.clearCookies(); + cy.clearCookies(); cy.visit('/me/profile'); cy.login('rahel.cueni', 'test'); }); diff --git a/client/src/main.js b/client/src/main.js index cdb59a5d..3a6da63c 100644 --- a/client/src/main.js +++ b/client/src/main.js @@ -124,7 +124,6 @@ router.beforeEach((to, from, next) => { } else { next(); } - // todo handle public pages for user }); /* eslint-disable no-new */ diff --git a/server/core/settings_test.py b/server/core/settings_test.py index a480a60b..d7fef8b6 100644 --- a/server/core/settings_test.py +++ b/server/core/settings_test.py @@ -14,3 +14,4 @@ MIGRATION_MODULES = DisableMigrations() # Email Settings SENDGRID_API_KEY = "" EMAIL_BACKEND = 'django.core.mail.backends.dummy.EmailBackend' +LOGIN_REDIRECT_URL = '/accounts/login/' diff --git a/server/core/static/styles/main.scss b/server/core/static/styles/main.scss index 1ed62182..b6b95d6f 100644 --- a/server/core/static/styles/main.scss +++ b/server/core/static/styles/main.scss @@ -1,5 +1,3 @@ -//@import "materialize/materialize"; - $white: #fff; $grey-1: #F7F7F7; diff --git a/server/core/tests/test_api.py b/server/core/tests/test_api.py index 0e0e0858..643058d7 100644 --- a/server/core/tests/test_api.py +++ b/server/core/tests/test_api.py @@ -1,7 +1,9 @@ import json from django.test import TestCase, Client +from django.test.utils import override_settings +from core import settings from core.factories import UserFactory @@ -17,7 +19,8 @@ class ApiAccessTestCase(TestCase): def test_graphqlEndpoint_shouldNotBeAccessibleWithoutLogin(self): c = Client() response = c.post('/api/graphql/', data=self.query, content_type='application/json') - self.assertRedirects(response, '/login?next=/api/graphql/') + self.assertEqual(response.status_code, 302) + self.assertEqual(response.url, '/login?next=/api/graphql/') def test_graphqlEndpoint_shouldBeAccessibleWithLogin(self): user = UserFactory(username='admin')