(self)
| 2362 | self.assertEqual(list(author_qs), [337]) |
| 2363 | |
| 2364 | def test_aggregate_arity(self): |
| 2365 | funcs_with_inherited_constructors = [Avg, Max, Min, Sum] |
| 2366 | msg = "takes exactly 1 argument (2 given)" |
| 2367 | for function in funcs_with_inherited_constructors: |
| 2368 | with ( |
| 2369 | self.subTest(function=function), |
| 2370 | self.assertRaisesMessage(TypeError, msg), |
| 2371 | ): |
| 2372 | function(Value(1), Value(2)) |
| 2373 | |
| 2374 | funcs_with_custom_constructors = [Count, StdDev, Variance] |
| 2375 | for function in funcs_with_custom_constructors: |
| 2376 | with self.subTest(function=function): |
| 2377 | # Extra arguments are rejected via the constructor. |
| 2378 | with self.assertRaises(TypeError): |
| 2379 | function(Value(1), True, Value(2)) |
| 2380 | # If the constructor is skipped, the arity check runs. |
| 2381 | func_instance = function(Value(1), True) |
| 2382 | with self.assertRaisesMessage(TypeError, msg): |
| 2383 | super(function, func_instance).__init__(Value(1), Value(2)) |
| 2384 | |
| 2385 | @skipIfDBFeature("supports_bit_aggregations") |
| 2386 | def test_bit_aggregations_not_supported(self): |
nothing calls this directly
no test coverage detected