def test_list_actions(self): user_log.log_user_action(self.user_object.id, action='/testaction') action = user_log.list_actions(user=self.user_object) self.assertIsNotNone(action) expected = {'action': '/testaction', 'user_id': 1} self.assertTrue( all(item in action[0].items() for item in expected.items()))
def test_list_actions(self): user_log.log_user_action( self.user_object.id, action='/testaction' ) action = user_log.list_actions(self.user_object) self.assertIsNotNone(action)
def list_all_user_actions(): """List all users actions.""" data = _get_request_args() _filter_timestamp(data) return utils.make_json_response( 200, user_log_api.list_actions( current_user, **data ) )
def test_del_actions(self): user_log.log_user_action( self.user_object.id, action='/testaction' ) user_log.del_actions( user=self.user_object ) del_action = user_log.list_actions( user=self.user_object ) self.assertEqual([], del_action)
def test_list_actions(self): user_log.log_user_action( self.user_object.id, action='/testaction' ) action = user_log.list_actions(user=self.user_object) self.assertIsNotNone(action) expected = { 'action': '/testaction', 'user_id': 1 } self.assertTrue( all(item in action[0].items() for item in expected.items()))
def test_del_actions(self): user_log.log_user_action(self.user_object.id, action='/testaction') user_log.del_actions(user=self.user_object) del_action = user_log.list_actions(user=self.user_object) self.assertEqual([], del_action)