Пример #1
0
 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()))
Пример #2
0
 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)
Пример #3
0
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
        )
    )
Пример #4
0
 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)
Пример #5
0
 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()))
Пример #6
0
 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)