

@run_with_all_backends
def test_match_has_value(self):
    with _with_case(self.domain, 'test-case-type-2', datetime(2015, 1, 1)) as case:
        self.rule2.automaticupdaterulecriteria_set = [AutomaticUpdateRuleCriteria(property_name='property3', match_type=AutomaticUpdateRuleCriteria.MATCH_HAS_VALUE)]
        self.assertFalse(self.rule2.rule_matches_case(case, datetime(2016, 1, 1)))
        set_case_property_directly(case, 'property3', 'x')
        self.assertTrue(self.rule2.rule_matches_case(case, datetime(2016, 1, 1)))
        set_case_property_directly(case, 'property3', '')
        self.assertFalse(self.rule2.rule_matches_case(self, datetime(2016, 1, 1)))

dataset/ETHPy150Open dimagi/commcare-hq/corehq/apps/data_interfaces/tests/test_auto_case_updates.py AutomaticCaseUpdateTest.test_match_has_value/VarMisuse@131/200 `case`->`self`