Ticket #26638 added support for accepting callables in the 'defaults' parameter of get_or_create and update_or_create. In the case where update_or_create is updating, the callables are not evaluated. I have written a test for update_or_create that demonstrates this behavior (attached).
Here is the traceback for that test failure:
======================================================================
FAIL: test_update_callable_default (get_or_create.tests.UpdateOrCreateTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib64/python2.7/unittest/case.py", line 369, in run
testMethod()
File "/home/default/sandbox/django/tests/get_or_create/tests.py", line 423, in test_update_callable_default
self.assertEqual(obj.last_name, 'NotHarrison')
File "/usr/lib64/python2.7/unittest/case.py", line 553, in assertEqual
assertion_func(first, second, msg=msg)
File "/usr/lib64/python2.7/unittest/case.py", line 546, in _baseAssertEqual
raise self.failureException(msg)
AssertionError: <function <lambda> at 0x22d0320> != u'NotHarrison'
----------------------------------------------------------------------
PR