def setUp(self): BaseTest.setUp(self) self.storage = TemporaryStorage() # Save a test image. self.filename = self.create_image(self.storage, 'test.jpg') # Required so that IOError's get wrapped as TemplateSyntaxError settings.TEMPLATE_DEBUG = True
def setUp(self): BaseTest.setUp(self) self.storage = TemporaryStorage() # Save a test image. self.create_image(self.storage, 'avatars/avatar.jpg') # Set the test model to use the current temporary storage. TestModel._meta.get_field('avatar').storage = self.storage TestModel._meta.get_field('avatar').thumbnail_storage = self.storage
def setUp(self): BaseTest.setUp(self) self.storage = TemporaryStorage() # Save a test image. data = StringIO() Image.new('RGB', (800, 600)).save(data, 'JPEG') data.seek(0) image_file = ContentFile(data.read()) self.storage.save(self.RELATIVE_PIC_NAME, image_file)
def setUp(self): BaseTest.setUp(self) self.storage = TemporaryStorage() # Save a test image. data = StringIO() Image.new('RGB', (800, 600)).save(data, 'JPEG') data.seek(0) image_file = ContentFile(data.read()) self.storage.save('avatars/avatar.jpg', image_file) # Set the test model to use the current temporary storage. TestModel._meta.get_field('avatar').storage = self.storage TestModel._meta.get_field('avatar').thumbnail_storage = self.storage
def setUp(self): BaseTest.setUp(self) self.storage = TemporaryStorage() # Save a test image. data = StringIO() Image.new('RGB', (800, 600)).save(data, 'JPEG') data.seek(0) image_file = ContentFile(data.read()) self.storage.save(self.RELATIVE_PIC_NAME, image_file) # Required so that IOError's get wrapped as TemplateSyntaxError settings.TEMPLATE_DEBUG = True
def tearDown(self): self.storage.delete_temporary_storage() BaseTest.tearDown(self)