forked from rc/aircox
41 lines
751 B
Python
41 lines
751 B
Python
import pytest
|
|
from model_bakery import baker
|
|
|
|
from aircox import models
|
|
|
|
|
|
class FakeView:
|
|
context = None
|
|
kwargs = {}
|
|
|
|
def ___init__(self):
|
|
self.kwargs = {}
|
|
|
|
def get(self, *args, **kwargs):
|
|
pass
|
|
|
|
def get_queryset(self):
|
|
return self.queryset
|
|
|
|
def get_context_data(self, **kwargs):
|
|
return kwargs
|
|
|
|
|
|
@pytest.fixture
|
|
def published_pages():
|
|
return baker.make(
|
|
models.Page, status=models.StaticPage.STATUS_PUBLISHED, _quantity=3
|
|
)
|
|
|
|
|
|
@pytest.fixture
|
|
def unpublished_pages():
|
|
return baker.make(
|
|
models.Page, status=models.StaticPage.STATUS_DRAFT, _quantity=3
|
|
)
|
|
|
|
|
|
@pytest.fixture
|
|
def pages(published_pages, unpublished_pages):
|
|
return published_pages + unpublished_pages
|