diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/expressions_window/tests.py | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/tests/expressions_window/tests.py b/tests/expressions_window/tests.py index ee51ace93b..fb14e56349 100644 --- a/tests/expressions_window/tests.py +++ b/tests/expressions_window/tests.py @@ -838,23 +838,24 @@ class WindowFunctionTests(TestCase): max=Window( expression=Max("salary"), partition_by=[F("department"), F("hire_date__year")], - ) + ), + past_department_count=Count("past_departments"), ).order_by("department", "hire_date", "name") self.assertQuerySetEqual( qs, [ - ("Jones", 45000, "Accounting", datetime.date(2005, 11, 1), 45000), - ("Jenson", 45000, "Accounting", datetime.date(2008, 4, 1), 45000), - ("Williams", 37000, "Accounting", datetime.date(2009, 6, 1), 37000), - ("Adams", 50000, "Accounting", datetime.date(2013, 7, 1), 50000), - ("Wilkinson", 60000, "IT", datetime.date(2011, 3, 1), 60000), - ("Moore", 34000, "IT", datetime.date(2013, 8, 1), 34000), - ("Miller", 100000, "Management", datetime.date(2005, 6, 1), 100000), - ("Johnson", 80000, "Management", datetime.date(2005, 7, 1), 100000), - ("Smith", 38000, "Marketing", datetime.date(2009, 10, 1), 38000), - ("Johnson", 40000, "Marketing", datetime.date(2012, 3, 1), 40000), - ("Smith", 55000, "Sales", datetime.date(2007, 6, 1), 55000), - ("Brown", 53000, "Sales", datetime.date(2009, 9, 1), 53000), + ("Jones", 45000, "Accounting", datetime.date(2005, 11, 1), 45000, 0), + ("Jenson", 45000, "Accounting", datetime.date(2008, 4, 1), 45000, 0), + ("Williams", 37000, "Accounting", datetime.date(2009, 6, 1), 37000, 0), + ("Adams", 50000, "Accounting", datetime.date(2013, 7, 1), 50000, 0), + ("Wilkinson", 60000, "IT", datetime.date(2011, 3, 1), 60000, 0), + ("Moore", 34000, "IT", datetime.date(2013, 8, 1), 34000, 0), + ("Miller", 100000, "Management", datetime.date(2005, 6, 1), 100000, 1), + ("Johnson", 80000, "Management", datetime.date(2005, 7, 1), 100000, 0), + ("Smith", 38000, "Marketing", datetime.date(2009, 10, 1), 38000, 0), + ("Johnson", 40000, "Marketing", datetime.date(2012, 3, 1), 40000, 1), + ("Smith", 55000, "Sales", datetime.date(2007, 6, 1), 55000, 0), + ("Brown", 53000, "Sales", datetime.date(2009, 9, 1), 53000, 0), ], transform=lambda row: ( row.name, @@ -862,6 +863,7 @@ class WindowFunctionTests(TestCase): row.department, row.hire_date, row.max, + row.past_department_count, ), ) |
