Пример #1
0
 def test_sync_usercase_custom_user_data_on_update(self):
     """
     Custom user data should be synced when the user is updated
     """
     self.user.user_data = {
         'completed_training': 'no',
     }
     self.user.save()
     self.user.user_data = {
         'completed_training': 'yes',
     }
     sync_usercase(self.user)
     case = get_case_by_domain_hq_user_id(TEST_DOMAIN, self.user._id, USERCASE_TYPE)
     self.assertEquals(case.completed_training, 'yes')
Пример #2
0
 def test_sync_usercase_custom_user_data_on_update(self):
     """
     Custom user data should be synced when the user is updated
     """
     self.user.user_data = {
         'completed_training': 'no',
     }
     self.user.save()
     self.user.user_data = {
         'completed_training': 'yes',
     }
     sync_usercase(self.user)
     case = CaseAccessors(TEST_DOMAIN).get_case_by_domain_hq_user_id(self.user._id, USERCASE_TYPE)
     self.assertEquals(case.dynamic_case_properties()['completed_training'], 'yes')
Пример #3
0
 def test_sync_usercase_custom_user_data_on_update(self):
     """
     Custom user data should be synced when the user is updated
     """
     self.user.user_data = {
         'completed_training': 'no',
     }
     self.user.save()
     self.user.user_data = {
         'completed_training': 'yes',
     }
     sync_usercase(self.user)
     case = CaseAccessors(TEST_DOMAIN).get_case_by_domain_hq_user_id(
         self.user._id, USERCASE_TYPE)
     self.assertEqual(case.dynamic_case_properties()['completed_training'],
                      'yes')
Пример #4
0
def create_user_cases(domain_name):
    from corehq.apps.callcenter.utils import sync_usercase
    for user in CommCareUser.by_domain(domain_name):
        sync_usercase(user)
Пример #5
0
def sync_user_cases_signal(sender, **kwargs):
    user = kwargs["couch_user"]
    sync_call_center_user_case(user)
    sync_usercase(user)
Пример #6
0
def create_user_cases(domain_name):
    from corehq.apps.callcenter.utils import sync_usercase
    for user in CommCareUser.by_domain(domain_name):
        sync_usercase(user)
Пример #7
0
def sync_user_cases_signal(sender, **kwargs):
    user = kwargs["couch_user"]
    sync_call_center_user_case(user)
    sync_usercase(user)