Ticket #12163: 12163_test.diff
File 12163_test.diff, 983 bytes (added by , 15 years ago) |
---|
-
tests/regressiontests/defer_regress/models.py
115 115 >>> results[0].second_child.name 116 116 u'c2' 117 117 118 # Test for #12163 - Pickling error saving session with unsaved model instances. 119 >>> from django.contrib.sessions.backends.db import SessionStore 120 >>> SESSION_KEY = '2b1189a188b44ad18c35e1baac6ceead' 121 >>> item = Item() 122 >>> s = SessionStore(SESSION_KEY) 123 >>> s.clear() 124 >>> s['item'] = item 125 >>> s.save() 126 >>> s = SessionStore(SESSION_KEY) # Reloads item as Item_Deferred_ instance. 127 >>> s.modified = True 128 >>> s.save() # Must be able to pickle Item_Deferred_. 129 118 130 # Finally, we need to flush the app cache for the defer module. 119 131 # Using only/defer creates some artifical entries in the app cache 120 132 # that messes up later tests. Purge all entries, just to be sure.