Ticket #8740: 8740_r8911_save_force_update.v3.diff
File 8740_r8911_save_force_update.v3.diff, 821 bytes (added by , 16 years ago) |
---|
-
tests/modeltests/force_insert_update/models.py
54 54 55 55 # Trying to update should still fail, even with manual primary keys, if the 56 56 # data isn't in the database already. 57 >>> sid = transaction.savepoint() 57 58 >>> obj = WithCustomPK(name=1, value=1) 58 >>> obj.save(force_update=True) 59 Traceback (most recent call last): 60 ... 61 DatabaseError: ... 59 >>> try: 60 ... obj.save(force_update=True) 61 ... except Exception, e: 62 ... if isinstance(e, IntegrityError): 63 ... print "Pass" 64 ... else: 65 ... print "Fail with %s" % type(e) 66 Pass 67 >>> transaction.savepoint_rollback(sid) 62 68 63 69 """ 64 70 }