Beispiel #1
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
Beispiel #2
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
Beispiel #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
Beispiel #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)
Beispiel #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)
Beispiel #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
Beispiel #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
Beispiel #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
Beispiel #10
0
 def tearDown(self):
     self.storage.delete_temporary_storage()
     BaseTest.tearDown(self)
Beispiel #11
0
 def tearDown(self):
     self.storage.delete_temporary_storage()
     BaseTest.tearDown(self)