mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
Refs #33476 -- Reformatted code with Black.
This commit is contained in:
committed by
Mariusz Felisiak
parent
f68fa8b45d
commit
9c19aff7c7
@@ -4,36 +4,36 @@ from django.test import SimpleTestCase
|
||||
|
||||
class ValidationTests(SimpleTestCase):
|
||||
def test_nth_negative_nth_value(self):
|
||||
msg = 'NthValue requires a positive integer as for nth'
|
||||
msg = "NthValue requires a positive integer as for nth"
|
||||
with self.assertRaisesMessage(ValueError, msg):
|
||||
NthValue(expression='salary', nth=-1)
|
||||
NthValue(expression="salary", nth=-1)
|
||||
|
||||
def test_nth_null_expression(self):
|
||||
msg = 'NthValue requires a non-null source expression'
|
||||
msg = "NthValue requires a non-null source expression"
|
||||
with self.assertRaisesMessage(ValueError, msg):
|
||||
NthValue(expression=None)
|
||||
|
||||
def test_lag_negative_offset(self):
|
||||
msg = 'Lag requires a positive integer for the offset'
|
||||
msg = "Lag requires a positive integer for the offset"
|
||||
with self.assertRaisesMessage(ValueError, msg):
|
||||
Lag(expression='salary', offset=-1)
|
||||
Lag(expression="salary", offset=-1)
|
||||
|
||||
def test_lead_negative_offset(self):
|
||||
msg = 'Lead requires a positive integer for the offset'
|
||||
msg = "Lead requires a positive integer for the offset"
|
||||
with self.assertRaisesMessage(ValueError, msg):
|
||||
Lead(expression='salary', offset=-1)
|
||||
Lead(expression="salary", offset=-1)
|
||||
|
||||
def test_null_source_lead(self):
|
||||
msg = 'Lead requires a non-null source expression'
|
||||
msg = "Lead requires a non-null source expression"
|
||||
with self.assertRaisesMessage(ValueError, msg):
|
||||
Lead(expression=None)
|
||||
|
||||
def test_null_source_lag(self):
|
||||
msg = 'Lag requires a non-null source expression'
|
||||
msg = "Lag requires a non-null source expression"
|
||||
with self.assertRaisesMessage(ValueError, msg):
|
||||
Lag(expression=None)
|
||||
|
||||
def test_negative_num_buckets_ntile(self):
|
||||
msg = 'num_buckets must be greater than 0'
|
||||
msg = "num_buckets must be greater than 0"
|
||||
with self.assertRaisesMessage(ValueError, msg):
|
||||
Ntile(num_buckets=-1)
|
||||
|
||||
Reference in New Issue
Block a user