-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
d.choban
committed
Feb 23, 2018
1 parent
6df4553
commit e98bf21
Showing
1 changed file
with
19 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import pytest | ||
from django.urls import reverse | ||
from tests.factories import ArticleFactory | ||
|
||
|
||
@pytest.mark.django_db | ||
class TestPagination(object): | ||
""" | ||
Test Arctic pagination | ||
""" | ||
def test_paginated_list(self, admin_client): | ||
[ArticleFactory() for i in range(20)] | ||
response = admin_client.get("%s?page=2" % reverse('articles:list')) | ||
assert response.status_code == 200 | ||
|
||
def test_page_out_of_list(self, admin_client): | ||
[ArticleFactory() for i in range(20)] | ||
response = admin_client.get("%s?page=20" % reverse('articles:list')) | ||
assert response.status_code == 404 |