class TemporaryImageFileTest(TestCase): def setUp(self): path = os.path.join( os.getcwd(), 'photos/tests/fixtures/blake-small.jpg' ) upload_file = open(path, 'rb') file = SimpleUploadedFile(upload_file.name, upload_file.read()) self.tmp_file = TemporaryImageFile(file) def tearDown(self): self.tmp_file.delete() def test_instance(self): self.assertIsInstance(self.tmp_file, TemporaryImageFile)
def setUp(self): path = os.path.join( os.getcwd(), 'photos/tests/fixtures/blake-small.jpg' ) upload_file = open(path, 'rb') file = SimpleUploadedFile(upload_file.name, upload_file.read()) self.tmp_file = TemporaryImageFile(file)