Ejemplo n.º 1
0
    def test_delete(self):
        file = File()
        file.filename.save('1.jpg', FILES[0])
        filepath = file.filename.path
        file.delete()

        if os.path.exists(filepath):
            self.fail("Associated file was not deleted after instance deletion.")
Ejemplo n.º 2
0
    def test_file_creation(self):
        file = File()
        file.filename.save('1.jpg', FILES[0])

        if not os.path.exists(file.filename.path):
            self.fail("File file was saved properly.")

        self.assertEqual(file.title, '1')

        file.delete()