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