0
我有一个Django应用程序这个看似简单的测试情况下,失败:为什么我的django模型没有保存?
def test_matches(self):
# setup code...
matches = tournament.match_set.order_by('match_id')
matches[0].winner = 'a'
matches[0].save()
self.assertEqual(matches[0].winner, 'a')
什么问题?
https://docs.djangoproject.com/en/1.8/ref/models/querysets/#when-querysets-are-evaluated – Wtower