Skip to content

Commit

Permalink
Fix in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
RamezIssac committed Jun 16, 2024
1 parent fc56add commit 8fee385
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
9 changes: 9 additions & 0 deletions tests/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,12 @@
DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"

CRISPY_TEMPLATE_PACK = "bootstrap4"


MIDDLEWARE = [
"django.middleware.security.SecurityMiddleware",
"django.contrib.sessions.middleware.SessionMiddleware",
"django.middleware.common.CommonMiddleware",
"django.middleware.csrf.CsrfViewMiddleware",
"django.contrib.auth.middleware.AuthenticationMiddleware",
]
17 changes: 10 additions & 7 deletions tests/tests.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import datetime
from unittest import skip
from unittest.mock import patch

from django.contrib.auth import get_user_model
from django.db.models import Count
Expand Down Expand Up @@ -417,13 +418,15 @@ def test_view_filter_to_field_set(self):
time_series_columns=["__total__", "__balance__"],
)
data = report_generator.get_report_data()
response = self.client.get(
reverse("report-to-field-set"),
data={
"client_id": [self.client2.name, self.client1.name],
},
HTTP_X_REQUESTED_WITH="XMLHttpRequest",
)

with patch("slick_reporting.helpers.user_test_function", return_value=True):
response = self.client.get(
reverse("report-to-field-set"),
data={
"client_id": [self.client2.name, self.client1.name],
},
HTTP_X_REQUESTED_WITH="XMLHttpRequest",
)
self.assertEqual(response.status_code, 200)

response.json()
Expand Down

0 comments on commit 8fee385

Please sign in to comment.