@run_with_all_backends
    def testCacheNonInvalidation(self):
        original_payload = RestoreConfig(
            project=self.project,
            user=self.user,
            params=RestoreParams(
                version=V2,
                sync_log_id=self.sync_log._id,
            ),
        ).get_payload().as_string()
        self.sync_log = get_properly_wrapped_sync_log(self.sync_log._id)
        self.assertTrue(self.sync_log.has_cached_payload(V2))

        # posting a case associated with this sync token should invalidate the cache
        # submitting a case not with the token will not touch the cache for that token
        case_id = "cache_noninvalidation"
        post_case_blocks([CaseBlock(
            create=True,
            case_id=case_id,
            user_id=self.user.user_id,
            owner_id=self.user.user_id,
            case_type=PARENT_TYPE,
        ).as_xml()])
        next_payload = RestoreConfig(
            project=self.project,
            user=self.user,
            params=RestoreParams(
                version=V2,
                sync_log_id=self.sync_log._id,
            ),
        ).get_payload().as_string()
        self.assertEqual(original_payload, next_payload)
        self.assertFalse(case_id in next_payload)
dataset/ETHPy150Open dimagi/commcare-hq/corehq/ex-submodules/casexml/apps/phone/tests/test_sync_mode.py/SyncTokenCachingTest.testCacheNonInvalidation/original