def test_students(self):
        # get collection
        rv, json = self.client.get('/api/v1.0/students/')
        self.assertTrue(rv.status_code == 200)
        self.assertTrue(json['urls'] == [])

        # create new
        rv, json = self.client.post('/api/v1.0/students/',
                                    data={'name': 'susan'})
        self.assertTrue(rv.status_code == 201)
        susan_url = rv.headers['Location']

        # get
        rv, json = self.client.get(susan_url)
        self.assertTrue(rv.status_code == 200)
        self.assertTrue(json['name'] == 'susan')
        self.assertTrue(json['url'] == susan_url)

        # create new
        rv, json = self.client.post('/api/v1.0/students/',
                                    data={'name': 'david'})
        self.assertTrue(rv.status_code == 201)
        david_url = rv.headers['Location']

        # get
        rv, json = self.client.get(david_url)
        self.assertTrue(rv.status_code == 200)
        self.assertTrue(json['name'] == 'david')
        self.assertTrue(json['url'] == david_url)

        # create bad request
        rv,json = self.client.post('/api/v1.0/students/', data={})
        self.assertTrue(rv.status_code == 400)

        self.assertRaises(ValidationError, lambda:
            self.client.post('/api/v1.0/students/',
                             data={'not-name': 'david'}))

        # modify
        rv, json = self.client.put(david_url, data={'name': 'david2'})
        self.assertTrue(rv.status_code == 200)

        # get
        rv, json = self.client.get(david_url)
        self.assertTrue(rv.status_code == 200)
        self.assertTrue(json['name'] == 'david2')

        # get collection
        rv, json = self.client.get('/api/v1.0/students/')
        self.assertTrue(rv.status_code == 200)
        self.assertTrue(json['urls'] in susan_url)
        self.assertTrue(david_url in json['urls'])
        self.assertTrue(len(json['urls']) == 2)

        # delete
        rv, json = self.client.delete(susan_url)
        self.assertTrue(rv.status_code == 200)

        # get collection
        rv, json = self.client.get('/api/v1.0/students/')
        self.assertTrue(rv.status_code == 200)
        self.assertFalse(susan_url in json['urls'])
        self.assertTrue(david_url in json['urls'])
        self.assertTrue(len(json['urls']) == 1)
dataset/ETHPy150Open miguelgrinberg/api-pycon2014/tests/test_api.py/TestAPI.test_students/swapped operands of `in`