diff --git a/django_lostplaces/lostplaces/tests/views/test_base_views.py b/django_lostplaces/lostplaces/tests/views/test_base_views.py index a483579..57e8ceb 100644 --- a/django_lostplaces/lostplaces/tests/views/test_base_views.py +++ b/django_lostplaces/lostplaces/tests/views/test_base_views.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +23238#!/usr/bin/env python # -*- coding: utf-8 -*- from django.test import TestCase, RequestFactory, Client @@ -6,6 +6,7 @@ from django.urls import reverse_lazy from django.contrib.auth.models import User, AnonymousUser from django.contrib.messages.storage.fallback import FallbackStorage from django.utils import timezone +from django.shortcuts import render from lostplaces.models import Place from lostplaces.views import IsAuthenticatedMixin @@ -33,14 +34,14 @@ class TestIsAuthenticated(ViewTestCase): self.assertHttpMethodNotAllowed(response) def test_not_logged_in(self): - request = RequestFactory().get('/someurl1234') + request = RequestFactory().get('/') request.user = AnonymousUser() request.session = 'session' messages = FallbackStorage(request) request._messages = messages response = IsAuthenticatedMixin.as_view()(request) - self.assertHttpRedirect(response, '?'.join([str(reverse_lazy('login')), 'next=/someurl1234'])) + self.assertHttpRedirect(response, '?'.join([str(reverse_lazy('login')), 'next=/'])) response = self.client.get(response['Location']) self.assertTrue(len(messages) > 0) @@ -86,4 +87,5 @@ class TestIsPlaceSubmitterMixin(TestCase): response = self.client.get(reverse_lazy('place_edit', kwargs={'pk': 1})) self.assertEqual(response.status_code, 403) self.assertTrue(response.context['messages']) - self.assertTrue(len(response.context['messages']) > 0) \ No newline at end of file + self.assertTrue(len(response.context['messages']) > 0) + \ No newline at end of file