docstr: Log API: Test recent activity pagination arguments
docstr_tok: ["Log","API",":","Test","recent","activity","pagination","arguments"]
code: def test_get_recent_activity_pagination(self):
      """
      Log API: Test recent activity pagination arguments
      """
      admin_user = self.get_user("admin")
      self.login(username="admin")
      dash = create_dashboard("dash_slug", "dash_title", "{}", [])
      dash2 = create_dashboard("dash2_slug", "dash2_title", "{}", [])
      dash3 = create_dashboard("dash3_slug", "dash3_title", "{}", [])
      log = self.insert_log(
          "dashboard", admin_user, dashboard_id=dash.id
      )
      log2 = self.insert_log(
          "dashboard", admin_user, dashboard_id=dash2.id
      )
      log3 = self.insert_log(
          "dashboard", admin_user, dashboard_id=dash3.id
      )
  
      now = datetime.now()
      log3.dttm = now
      log2.dttm = now - timedelta(days=1)
      log.dttm = now - timedelta(days=2)
  
      arguments = {"page": 0, "page_size": 2}
      uri = f"api/v1/log/recent_activity/?q={prison.dumps(arguments)}"
      rv = self.client.get(uri)
  
      self.assertEqual(rv.status_code, 200)
      response = json.loads(rv.data.decode("utf-8"))
      self.assertEqual(
          response,
          {
              "result": [
                  {
                      "action": "dashboard",
                      "item_type": "dashboard",
                      "item_url": "/superset/dashboard/dash3_slug/",
                      "item_title": "dash3_title",
                      "time": ANY,
                      "time_delta_humanized": ANY,
                  },
                  {
                      "action": "dashboard",
                      "item_type": "dashboard",
                      "item_url": "/superset/dashboard/dash2_slug/",
                      "item_title": "dash2_title",
                      "time": ANY,
                      "time_delta_humanized": ANY,
                  },
              ]
          },
      )
  
      arguments = {"page": 1, "page_size": 2}
      uri = f"api/v1/log/recent_activity/?q={prison.dumps(arguments)}"
      rv = self.client.get(uri)
  
      db.session.delete(log)
      db.session.delete(log2)
      db.session.delete(log3)
      db.session.delete(dash)
      db.session.delete(dash2)
      db.session.delete(dash3)
      db.session.commit()
  
      self.assertEqual(rv.status_code, 200)
      response = json.loads(rv.data.decode("utf-8"))
      self.assertEqual(
          response,
          {
              "result": [
                  {
                      "action": "dashboard",
                      "item_type": "dashboard",
                      "item_url": "/superset/dashboard/dash_slug/",
                      "item_title": "dash_title",
                      "time": ANY,
                      "time_delta_humanized": ANY,
                  }
              ]
          },
      )
  
imports: from datetime import datetime, timedelta
  import json
  from typing import Optional
  from unittest.mock import ANY
  from flask_appbuilder.security.sqla.models import User
  import prison
  from unittest.mock import patch
  from superset import db
  from superset.models.core import Log
  from superset.views.log.api import LogRestApi
  from tests.integration_tests.conftest import with_feature_flags
  from tests.integration_tests.dashboard_utils import create_dashboard
  from tests.integration_tests.test_app import app
  from .base_tests import SupersetTestCase
label_desc: Use image node_id 11 for calling the TestLogApi obj's underlying member method code with example usage: obj.test_get_recent_activity_pagination() without return types