示例#1
0
 def test_get_bands_success(self):
     test_band = Band(name=self.test_band['name'],
                      city=self.test_band['city'],
                      state=self.test_band['state'])
     test_band.insert()
     res = self.client().get(
         '/bands',
         headers={"Authorization": "Bearer {}".format(self.manager)})
     self.assertEqual(res.status_code, 200)
     test_band.delete()
示例#2
0
    def test_patch_band_success(self):
        new_band = Band(name=self.test_band['name'],
                        city=self.test_band['city'],
                        state=self.test_band['state'])
        new_band.insert()

        res = self.client().patch(
            '/bands/{}'.format(new_band.id),
            json=self.test_band,
            headers={"Authorization": "Bearer {}".format(self.manager)})
        data = json.loads(res.data)
        self.assertEqual(res.status_code, 200)
        self.assertTrue(data['success'])
        new_band.delete()