forked from rc/aircox
feat: add error message page; improve admin ui; add missing test files
This commit is contained in:
40
aircox/tests/views/conftest.py
Normal file
40
aircox/tests/views/conftest.py
Normal file
@ -0,0 +1,40 @@
|
||||
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
|
||||
Reference in New Issue
Block a user