Esempio n. 1
0
    def test_source_file(self):
        ph = create_photo('pickletest.jpg')
        pickled_model = StringIO()
        pickle.dump(ph, pickled_model)
        pickled_model.seek(0)
        unpickled_model = pickle.load(pickled_model)

        # This isn't supposed to error.
        unpickled_model.thumbnail.source_file
Esempio n. 2
0
def pickleback(obj):
    pickled = StringIO()
    pickle.dump(obj, pickled)
    pickled.seek(0)
    return pickle.load(pickled)
Esempio n. 3
0
def pickleback(obj):
    pickled = StringIO()
    pickle.dump(obj, pickled)
    pickled.seek(0)
    return pickle.load(pickled)