Exemplo n.º 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
Exemplo n.º 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
Exemplo n.º 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
Exemplo n.º 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
Exemplo n.º 5
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)
Exemplo n.º 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)
Exemplo n.º 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
Exemplo n.º 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
Exemplo n.º 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
Exemplo n.º 10
0
 def tearDown(self):
     self.storage.delete_temporary_storage()
     BaseTest.tearDown(self)
Exemplo n.º 11
0
 def tearDown(self):
     self.storage.delete_temporary_storage()
     BaseTest.tearDown(self)