

def test_gets(self):
    resp = self.client.get('/api/v1/', data={
        'format': 'json',
    })
    self.assertEqual(resp.status_code, 200)
    deserialized = json.loads(resp.content)
    self.assertEqual(len(deserialized), 1)
    self.assertEqual(deserialized['products'], {
        'list_endpoint': '/api/v1/products/',
        'schema': '/api/v1/products/schema/',
    })
    resp = self.client.get('/api/v1/products/', data={
        'format': 'json',
    })
    self.assertEqual(resp.status_code, 200)
    deserialized = json.loads(resp.content)
    self.assertEqual(len(deserialized), 2)
    self.assertEqual(deserialized['meta']['limit'], 20)
    self.assertEqual(len(deserialized['objects']), 6)
    self.assertEqual([obj['name'] for obj in deserialized['objects']], ['Skateboardrampe', 'Bigwheel', 'Trampolin', 'Laufrad', 'Bigwheel', 'Trampolin'])
    resp = self.client.get('/api/v1/products/11111/', data={
        'format': 'json',
    })
    self.assertEqual(resp.status_code, 200)
    deserialized = json.loads(resp.content)
    self.assertEqual(len(deserialized), 5)
    self.assertEqual(deserialized['name'], 'Skateboardrampe')
    resp = self.client.get('/api/v1/products/set/11111;76123/', data={
        'format': 'json',
    })
    self.assertEqual(resp.status_code, 200)
    deserialized = json.loads(resp.content)
    self.assertEqual(len(deserialized), 1)
    self.assertEqual(len(deserialized['objects']), 2)
    self.assertEqual([obj['name'] for obj in deserialized['objects']], ['Skateboardrampe', 'Bigwheel'])
    resp = self.client.get('/api/v1/products/WS65150-01/', data={
        'format': 'json',
    })
    self.assertEqual(resp.status_code, 200)
    deserialized = json.loads(resp.content)
    self.assertEqual(len(deserialized), 5)
    self.assertEqual(deserialized['name'], 'Trampolin')
    resp = self.client.get('/api/v1/products/set/WS65150-01;65100A-01/', data={
        'format': 'json',
    })
    self.assertEqual(resp.status_code, 200)
    deserialized = json.loads(resp.content)
    self.assertEqual(len(deserialized), 1)
    self.assertEqual(len(deserialized['objects']), 2)
    self.assertEqual([obj['name'] for obj in deserialized['objects']], ['Trampolin', 'Laufrad'])
    resp = self.client.get('/api/v1/products/76123/01/', data={
        'format': 'json',
    })
    self.assertEqual(resp.status_code, 200)
    deserialized = json.loads(resp.content)
    self.assertEqual(len(deserialized), 5)
    self.assertEqual(deserialized['name'], 'Bigwheel')
    resp = self.client.get('/api/v1/products/set/76123/01;65100A-01/', data={
        'format': 'json',
    })
    self.assertEqual(resp.status_code, 200)
    deserialized = json.loads(resp.content)
    self.assertEqual(len(deserialized), 1)
    self.assertEqual(len(deserialized['objects']), 2)
    self.assertEqual([obj['name'] for obj in deserialized['objects']], ['Bigwheel', 'Laufrad'])
    resp = self.client.get('/api/v1/products/WS65150/01-01/', data={
        'format': 'json',
    })
    self.assertEqual(resp.status_code, 200)
    deserialized = json.loads(resp.content)
    self.assertEqual(len(deserialized), 5)
    self.assertEqual(deserialized['name'], 'Trampolin')
    resp = self.client.get('/api/v1/products/set/76123/01;WS65150/01-01/', data={
        'format': 'json',
    })
    self.assertEqual(resp.status_code, 200)
    deserialized = json.loads(resp.content)
    self.assertEqual(len(deserialized), 1)
    self.assertEqual(len(deserialized['objects']), 2)
    self.assertEqual([obj['name'] for obj in deserialized['objects']], ['Bigwheel', 'Trampolin'])

dataset/ETHPy150Open mozilla/inventory/vendor-local/src/django-tastypie/tests/alphanumeric/tests/views.py ViewsTestCase.test_gets/original