예제 #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
예제 #2
0
def pickleback(obj):
    pickled = StringIO()
    pickle.dump(obj, pickled)
    pickled.seek(0)
    return pickle.load(pickled)
예제 #3
0
def pickleback(obj):
    pickled = StringIO()
    pickle.dump(obj, pickled)
    pickled.seek(0)
    return pickle.load(pickled)