def test_sync_methods(self): player = self._get_player() coin = Coin.add('points') History.objects.create(user=player.user, coin=coin, amount=10) self.assertEqual(player.points, 0) scoring.sync_user(player) self.assertEqual(player.points, 10) History.objects.create(user=player.user, coin=coin, amount=10) self.assertEqual(player.points, 10) scoring.sync_all_user_points() player = Player.objects.get(pk=player.pk) self.assertEqual(player.points, 20)