mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-21 11:37:21 -06:00
Fix tests
This commit is contained in:
parent
702b4df8bb
commit
240ab4e44f
@ -1,4 +1,5 @@
|
|||||||
from django.test import TestCase
|
from django.test import TestCase
|
||||||
|
from django.conf import settings
|
||||||
|
|
||||||
from circuits.models import Circuit, CircuitTermination, CircuitType, Provider
|
from circuits.models import Circuit, CircuitTermination, CircuitType, Provider
|
||||||
from dcim.choices import *
|
from dcim.choices import *
|
||||||
@ -5240,7 +5241,7 @@ class CableTestCase(TestCase, ChangeLoggedFilterSetTests):
|
|||||||
def test_type(self):
|
def test_type(self):
|
||||||
params = {'type': [CableTypeChoices.TYPE_CAT3, CableTypeChoices.TYPE_CAT5E]}
|
params = {'type': [CableTypeChoices.TYPE_CAT3, CableTypeChoices.TYPE_CAT5E]}
|
||||||
self.assertEqual(self.filterset(params, self.queryset).qs.count(), 4)
|
self.assertEqual(self.filterset(params, self.queryset).qs.count(), 4)
|
||||||
params = {'type': [CableTypeChoices.TYPE_EMPTY]}
|
params = {'type': [settings.FILTERS_NULL_CHOICE_VALUE]}
|
||||||
params = {'type__empty': 'true'}
|
params = {'type__empty': 'true'}
|
||||||
self.assertEqual(self.filterset(params, self.queryset).qs.count(), 8)
|
self.assertEqual(self.filterset(params, self.queryset).qs.count(), 8)
|
||||||
params = {'type__empty': 'false'}
|
params = {'type__empty': 'false'}
|
||||||
@ -5249,7 +5250,7 @@ class CableTestCase(TestCase, ChangeLoggedFilterSetTests):
|
|||||||
def test_type_empty(self):
|
def test_type_empty(self):
|
||||||
params = {'type__empty': 'true'}
|
params = {'type__empty': 'true'}
|
||||||
self.assertEqual(self.filterset(params, self.queryset).qs.count(), 8)
|
self.assertEqual(self.filterset(params, self.queryset).qs.count(), 8)
|
||||||
params = {'type': [CableTypeChoices.TYPE_EMPTY, CableTypeChoices.TYPE_CAT3]}
|
params = {'type': [settings.FILTERS_NULL_CHOICE_VALUE, CableTypeChoices.TYPE_CAT3]}
|
||||||
self.assertEqual(self.filterset(params, self.queryset).qs.count(), 10)
|
self.assertEqual(self.filterset(params, self.queryset).qs.count(), 10)
|
||||||
|
|
||||||
def test_status(self):
|
def test_status(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user