code: def test_custom_pagination_pattern(self):
      from pelican.paginator import PaginationRule
  
      settings = get_settings()
      settings["PAGINATION_PATTERNS"] = [
          PaginationRule(*r)
          for r in [
              (1, "/{url}", "{base_name}/index.html"),
              (2, "/{url}{number}/", "{base_name}/{number}/index.html"),
          ]
      ]
  
      self.page_kwargs["metadata"]["author"] = Author(
          "Blogger", settings
      )
      object_list = [
          Article(**self.page_kwargs),
          Article(**self.page_kwargs),
      ]
      paginator = Paginator(
          "blog/index.html", "//blog.my.site/", object_list, settings, 1
      )
      # The URL *has to* stay absolute (with // in the front), so verify that
      page1 = paginator.page(1)
      self.assertEqual(page1.save_as, "blog/index.html")
      self.assertEqual(page1.url, "//blog.my.site/")
      page2 = paginator.page(2)
      self.assertEqual(page2.save_as, "blog/2/index.html")
      self.assertEqual(page2.url, "//blog.my.site/2/")
  
file_path: pelican/pelican/tests/test_paginator.py
imports: import locale
  from jinja2.utils import generate_lorem_ipsum
  from pelican.contents import Article, Author
  from pelican.paginator import Paginator
  from pelican.settings import DEFAULT_CONFIG
  from pelican.tests.support import get_settings, unittest
label_desc: Use image node_id 4 for calling the TestPage obj's underlying member method code with example usage: obj.test_custom_pagination_pattern() without return types