Skip to content

Commit

Permalink
Fix in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
RamezIssac committed Oct 3, 2023
1 parent fb0d485 commit 1be1759
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
1 change: 1 addition & 0 deletions docs/source/topics/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@ You saw how to use the ReportView class in the tutorial and you identified the t
integrating_slick_reporting
charts
exporting
computation_field
19 changes: 8 additions & 11 deletions tests/test_generator.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
from datetime import datetime

import pytz
from django.db.models import Sum
from django.test import TestCase
from django.utils.translation import gettext_lazy as _

from slick_reporting.fields import ComputationField
from slick_reporting.generator import ReportGenerator, ListViewReportGenerator
from slick_reporting.helpers import get_foreign_keys
from .models import OrderLine, ComplexSales
from django.utils.translation import gettext_lazy as _

from .models import SimpleSales, Client
from .report_generators import (
GeneratorWithAttrAsColumn,
CrosstabOnClient,
Expand All @@ -21,9 +20,7 @@
CrosstabCustomQueryset,
TestCountField,
)

from .tests import BaseTestData, year
from .models import SimpleSales, Client


class CrosstabTests(BaseTestData, TestCase):
Expand Down Expand Up @@ -146,8 +143,8 @@ def test_time_series_columns_inclusion(self):
columns=["name", "__time_series__"],
time_series_columns=["__total_quantity__"],
time_series_pattern="monthly",
start_date=datetime(2020, 1, 1, tzinfo=pytz.timezone("utc")),
end_date=datetime(2020, 12, 31, tzinfo=pytz.timezone("utc")),
start_date=datetime(2020, 1, 1),
end_date=datetime(2020, 12, 31),
)
self.assertEqual(len(x.get_list_display_columns()), 13)

Expand All @@ -161,8 +158,8 @@ def test_time_series_patterns(self):
columns=["name", "__time_series__"],
time_series_columns=["__total_quantity__"],
time_series_pattern="monthly",
start_date=datetime(2020, 1, 1, tzinfo=pytz.timezone("utc")),
end_date=datetime(2020, 12, 31, tzinfo=pytz.timezone("utc")),
start_date=datetime(2020, 1, 1),
end_date=datetime(2020, 12, 31),
)

dates = report._get_time_series_dates()
Expand Down Expand Up @@ -215,8 +212,8 @@ def test_time_series_columns_placeholder(self):
columns=["name"],
time_series_columns=["__total_quantity__"],
time_series_pattern="monthly",
start_date=datetime(2020, 1, 1, tzinfo=pytz.timezone("utc")),
end_date=datetime(2020, 12, 31, tzinfo=pytz.timezone("utc")),
start_date=datetime(2020, 1, 1),
end_date=datetime(2020, 12, 31),
)
self.assertEqual(len(x.get_list_display_columns()), 13)

Expand Down

0 comments on commit 1be1759

Please sign in to comment.