def remove_participant(self, alternative_name, participant_identifier): # Remove participation record counter_key = PARTICIPANT_KEY % (self.name, alternative_name) counters.clear(counter_key, participant_identifier) # Remove goal records for goal_name in conf.ALL_GOALS: counter_key = GOAL_KEY % (self.name, alternative_name, goal_name) counters.clear(counter_key, participant_identifier)
def test_clear_value(self): counters.increment(TEST_KEY, 'fred') counters.increment(TEST_KEY, 'fred') counters.increment(TEST_KEY, 'fred') counters.increment(TEST_KEY, 'barney') counters.increment(TEST_KEY, 'barney') counters.clear(TEST_KEY, 'fred') self.assertEqual(counters.get(TEST_KEY), 1) self.assertEqual(counters.get_frequencies(TEST_KEY), {2: 1})
def remove_participant(self, alternative_name, participant_identifier): # Remove participation record counter_key = PARTICIPANT_KEY % (self.name, alternative_name) counters.clear(counter_key, participant_identifier) # Remove goal records goal_names = getattr(settings, 'EXPERIMENTS_GOALS', []) for goal_name in goal_names: counter_key = GOAL_KEY % (self.name, alternative_name, goal_name) counters.clear(counter_key, participant_identifier)