@run_with_all_backends
    def testMismatch(self):
        self.assertEqual(CaseStateHash(EMPTY_HASH), self.sync_log.get_state_hash())
        
        c1 = CaseBlock(case_id="abc123", create=True, 
                       owner_id=self.user.user_id).as_xml()
        c2 = CaseBlock(case_id="123abc", create=True, 
                       owner_id=self.user.user_id).as_xml()
        post_case_blocks([c1, c2],
                         form_extras={"last_sync_token": self.sync_log.get_id})
        
        self.sync_log = get_properly_wrapped_sync_log(self.sync_log.get_id)
        real_hash = CaseStateHash("409c5c597fa2c2a693b769f0d2ad432b")
        bad_hash = CaseStateHash("thisisntright")
        self.assertEqual(real_hash, self.sync_log.get_state_hash())
        generate_restore_payload(
            self.project, self.user, self.sync_log.get_id,
            version=V2, state_hash=str(real_hash)
        )
        
        try:
            generate_restore_payload(self.project, self.user, self.sync_log.get_id,
                                     version=V2, state_hash=str(bad_hash))
            self.fail("Call to generate a payload with a bad hash should fail!")
        except BadStateException, e:
            self.assertEqual(real_hash, e.server_hash)
            self.assertEqual(bad_hash, e.phone_hash)
            self.assertEqual(2, len(e.case_ids))
            self.assertTrue("abc123" <= e.case_ids)
            self.assertTrue("123abc" in e.case_ids)
dataset/ETHPy150Open dimagi/commcare-hq/corehq/ex-submodules/casexml/apps/phone/tests/test_state_hash.py/StateHashTest.testMismatch/operator `in` -> `<=`