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
Exemple #3
0
 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
Exemple #4
0
    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.
     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)
Exemple #6
0
 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)
Exemple #7
0
 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
Exemple #8
0
    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
Exemple #9
0
 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
Exemple #10
0
 def tearDown(self):
     self.storage.delete_temporary_storage()
     BaseTest.tearDown(self)
Exemple #11
0
 def tearDown(self):
     self.storage.delete_temporary_storage()
     BaseTest.tearDown(self)