<nav class="pagination" aria-label="pagination">
<span class="page prev">
<a href="/lookbook/preview/previews/pagination_component/default/?page=19"
rel="prev"
data-el-querystring-key="page"
class="page prev">
‹ Prev
</a>
</span>
<span class="page" >
<a href="/lookbook/preview/previews/pagination_component/default/"
>1</a>
</span>
<span class="page" >
<a href="/lookbook/preview/previews/pagination_component/default/?page=2"
>2</a>
</span>
<span class="page" >
<a href="/lookbook/preview/previews/pagination_component/default/?page=3"
>3</a>
</span>
<span class="page gap">…</span>
<span class="page" >
<a href="/lookbook/preview/previews/pagination_component/default/?page=18"
>18</a>
</span>
<span class="page" >
<a href="/lookbook/preview/previews/pagination_component/default/?page=19"
>19</a>
</span>
<span class="page active">
<strong>20</strong>
</span>
<span class="page" >
<a href="/lookbook/preview/previews/pagination_component/default/?page=21"
>21</a>
</span>
<span class="page" >
<a href="/lookbook/preview/previews/pagination_component/default/?page=22"
>22</a>
</span>
<span class="page gap">…</span>
<span class="page" >
<a href="/lookbook/preview/previews/pagination_component/default/?page=48"
>48</a>
</span>
<span class="page" >
<a href="/lookbook/preview/previews/pagination_component/default/?page=49"
>49</a>
</span>
<span class="page" >
<a href="/lookbook/preview/previews/pagination_component/default/?page=50"
>50</a>
</span>
<span class="page next">
<a href="/lookbook/preview/previews/pagination_component/default/?page=21"
rel="next"
>Next ›
</a>
</span>
</nav>
def default(self, page=20, **kwargs):
request_factory = RequestFactory()
# get current preview url
url = reverse(
"django_lookbook:preview",
args=[PaginationComponentPreview.url[1:] + "default"],
)
mock_request = request_factory.get(url, {"page": page})
template = Template(
"""
{% load static %}
{% load svg heroicons el_pagination_tags %}
{% with entries="x"|rjust:"100"|make_list %}
{% paginate 2 entries %}
{% for entry in entries %}
{% endfor %}
{% get_pages %}
{% if pages.paginated %}
{{ pages.get_rendered }}
{% endif %}
{% endwith %}
""",
)
return template.render(Context({"request": mock_request}))