mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-24 08:25:17 -06:00
Fix bogus test_invalid_range_alphanumeric test
Input errors should throw exceptions, not return an empty list. Should not significantly change external behaviour, in the old versions a "Field is required" message was an end result of these cases.
This commit is contained in:
parent
e485ed30c7
commit
9f3c15201a
@ -275,8 +275,10 @@ class ExpandAlphanumeric(TestCase):
|
|||||||
self.assertEqual(sorted(expand_alphanumeric_pattern(input)), output)
|
self.assertEqual(sorted(expand_alphanumeric_pattern(input)), output)
|
||||||
|
|
||||||
def test_invalid_range_alphanumeric(self):
|
def test_invalid_range_alphanumeric(self):
|
||||||
self.assertEqual(sorted(expand_alphanumeric_pattern('r[9-a]a')), [])
|
with self.assertRaises(forms.ValidationError):
|
||||||
self.assertEqual(sorted(expand_alphanumeric_pattern('r[a-9]a')), [])
|
sorted(expand_alphanumeric_pattern('r[9-a]a'))
|
||||||
|
with self.assertRaises(forms.ValidationError):
|
||||||
|
sorted(expand_alphanumeric_pattern('r[a-9]a'))
|
||||||
|
|
||||||
def test_invalid_range_bounds(self):
|
def test_invalid_range_bounds(self):
|
||||||
with self.assertRaises(forms.ValidationError):
|
with self.assertRaises(forms.ValidationError):
|
||||||
|
Loading…
Reference in New Issue
Block a user