diff --git a/trackermaps/tests/test_trackermaps_views.py b/trackermaps/tests/test_trackermaps_views.py index 38952ae6..dca83e2e 100644 --- a/trackermaps/tests/test_trackermaps_views.py +++ b/trackermaps/tests/test_trackermaps_views.py @@ -2,10 +2,14 @@ import pytest from django.test import RequestFactory from django.urls import reverse +from users.models import User from trackermaps.views import maps +from mixer.backend.django import mixer logger = logging.getLogger(__name__) +pytestmark = pytest.mark.django_db + class TestTrackermapsJSONResponses: def test_400_response(self): @@ -18,5 +22,6 @@ def test_400_response(self): req = RequestFactory().post(reverse('trackermaps:maps'), data=arguments, HTTP_X_REQUESTED_WITH='XMLHttpRequest') + req.user = mixer.blend(User) resp = maps(req) assert resp.status_code == 400