def do_test(self, params, write=True): response = self.client.get( '/wms/datasets/{}'.format(self.dataset_slug), params) self.assertEqual(response.status_code, 200) if write is True: with open(image_path(self.__class__.__name__, self.image_name()), "wb") as f: f.write(response.content)
def do_test(self, params, fmt=None, write=True): fmt = fmt or 'png' response = self.client.get('/wms/datasets/{}'.format(self.dataset_slug), params) self.assertEqual(response.status_code, 200) outfile = image_path(self.__class__.__name__, self.image_name(fmt)) if write is True: with open(outfile, "wb") as f: f.write(response.content) return outfile
def do_test(self, params, write=True): response = self.client.get('/wms/datasets/{}'.format(self.dataset_slug), params) self.assertEqual(response.status_code, 200) if write is True: with open(image_path(self.__class__.__name__, self.image_name()), "wb") as f: f.write(response.content)