Exemplo n.º 1
0
 def test_device_mac_address_icontains_negation(self):
     params = {'mac_address__nic': ['aa:', 'bb']}
     self.assertEqual(
         DeviceFilterSet(params, self.device_queryset).qs.count(), 1)
Exemplo n.º 2
0
 def test_device_mac_address_startswith(self):
     params = {'mac_address__isw': ['aa:']}
     self.assertEqual(
         DeviceFilterSet(params, self.device_queryset).qs.count(), 1)
Exemplo n.º 3
0
 def test_device_mac_address_endswith_negation(self):
     params = {'mac_address__niew': [':02']}
     self.assertEqual(
         DeviceFilterSet(params, self.device_queryset).qs.count(), 2)
Exemplo n.º 4
0
 def test_device_mac_address_negation(self):
     params = {'mac_address__n': ['00-00-00-00-00-01', 'aa-00-00-00-00-01']}
     self.assertEqual(
         DeviceFilterSet(params, self.device_queryset).qs.count(), 2)
Exemplo n.º 5
0
 def test_device_name_icontains_negation(self):
     params = {'name__nic': [' ']}
     self.assertEqual(
         DeviceFilterSet(params, self.device_queryset).qs.count(), 0)
Exemplo n.º 6
0
 def test_device_name_endswith_negation(self):
     params = {'name__niew': [' 1']}
     self.assertEqual(
         DeviceFilterSet(params, self.device_queryset).qs.count(), 2)
Exemplo n.º 7
0
 def test_device_name_startswith(self):
     params = {'name__isw': ['Device']}
     self.assertEqual(
         DeviceFilterSet(params, self.device_queryset).qs.count(), 3)
Exemplo n.º 8
0
 def test_device_name_eq(self):
     params = {'name': ['Device 1']}
     self.assertEqual(
         DeviceFilterSet(params, self.device_queryset).qs.count(), 1)