mirror of
https://github.com/inventree/InvenTree.git
synced 2025-10-25 02:17:37 +00:00
improve check
This commit is contained in:
@@ -41,7 +41,7 @@ class SampleSerializer(
|
|||||||
|
|
||||||
def sample(self, obj):
|
def sample(self, obj):
|
||||||
"""Sample method field."""
|
"""Sample method field."""
|
||||||
return 'sample'
|
return 'sample123'
|
||||||
|
|
||||||
|
|
||||||
class SampleList(OutputOptionsMixin, ListCreateAPI):
|
class SampleList(OutputOptionsMixin, ListCreateAPI):
|
||||||
@@ -85,6 +85,8 @@ class FilteredSerializers(InvenTreeAPITestCase):
|
|||||||
self.assertContains(response, 'field_c')
|
self.assertContains(response, 'field_c')
|
||||||
self.assertContains(response, 'field_d')
|
self.assertContains(response, 'field_d')
|
||||||
|
|
||||||
|
self.assertEqual(response.data[0]['field_b'], 'sample123')
|
||||||
|
|
||||||
# Disable field_c using custom filter name
|
# Disable field_c using custom filter name
|
||||||
response = self.client.get(url, {'crazy_name': 'false'})
|
response = self.client.get(url, {'crazy_name': 'false'})
|
||||||
self.assertContains(response, 'field_a')
|
self.assertContains(response, 'field_a')
|
||||||
|
|||||||
Reference in New Issue
Block a user