def test_dupe_complete_results_keeps_both_finds_latest(self):

        with mock.patch("moztrap.model.mtmodel.utcnow") as mock_utcnow:
            mock_utcnow.return_value = datetime.datetime(2012, 3, 24)
            r = self.F.ResultFactory(
                status="passed",
                )
            mock_utcnow.return_value = datetime.datetime(2012, 3, 25)
            r2 = self.F.ResultFactory(
                tester=r.tester,
                runcaseversion=r.runcaseversion,
                environment=r.environment,
                status="failed",
                )

        self.assertEqual(
            self.result_for(
                r.runcaseversion, r.tester, r.environment, "{{ result.id }}"),
            str(r2.id),
            )
        self.assertEqual(self.model.Result.objects.count(), 2)
This will cache the contents of a template fragment for a given amount
dataset/ETHPy150Open mozilla/moztrap/tests/view/runtests/templatetags/test_execution.py/ResultForTest.test_dupe_complete_results_keeps_both_finds_latest--crossover with--dataset/ETHPy150Open AppScale/appscale/AppServer/google/appengine/_internal/django/templatetags/cache.py/do_cache