def test_device_mac_address_icontains_negation(self): params = {'mac_address__nic': ['aa:', 'bb']} self.assertEqual( DeviceFilterSet(params, self.device_queryset).qs.count(), 1)
def test_device_mac_address_startswith(self): params = {'mac_address__isw': ['aa:']} self.assertEqual( DeviceFilterSet(params, self.device_queryset).qs.count(), 1)
def test_device_mac_address_endswith_negation(self): params = {'mac_address__niew': [':02']} self.assertEqual( DeviceFilterSet(params, self.device_queryset).qs.count(), 2)
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)
def test_device_name_icontains_negation(self): params = {'name__nic': [' ']} self.assertEqual( DeviceFilterSet(params, self.device_queryset).qs.count(), 0)
def test_device_name_endswith_negation(self): params = {'name__niew': [' 1']} self.assertEqual( DeviceFilterSet(params, self.device_queryset).qs.count(), 2)
def test_device_name_startswith(self): params = {'name__isw': ['Device']} self.assertEqual( DeviceFilterSet(params, self.device_queryset).qs.count(), 3)
def test_device_name_eq(self): params = {'name': ['Device 1']} self.assertEqual( DeviceFilterSet(params, self.device_queryset).qs.count(), 1)