diff --git a/docs/source/topics/index.rst b/docs/source/topics/index.rst index e638d4f..23cd7ec 100644 --- a/docs/source/topics/index.rst +++ b/docs/source/topics/index.rst @@ -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 diff --git a/tests/test_generator.py b/tests/test_generator.py index 3d1401e..e0a584a 100644 --- a/tests/test_generator.py +++ b/tests/test_generator.py @@ -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, @@ -21,9 +20,7 @@ CrosstabCustomQueryset, TestCountField, ) - from .tests import BaseTestData, year -from .models import SimpleSales, Client class CrosstabTests(BaseTestData, TestCase): @@ -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) @@ -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() @@ -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)