Skip to content

Commit

Permalink
added basic tests
Browse files Browse the repository at this point in the history
  • Loading branch information
d.choban committed Feb 23, 2018
1 parent 6df4553 commit e98bf21
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/test_generics/test_pagination.py
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

0 comments on commit e98bf21

Please sign in to comment.