aircox-radiocampus/aircox/tests/views/conftest.py
Thomas Kairos f7a61fe6c0 Feat: packaging (#127)
- Add configuration files for packaging
- Precommit now uses ruff

Co-authored-by: bkfox <thomas bkfox net>
Reviewed-on: rc/aircox#127
2023-10-11 10:58:34 +02:00

37 lines
723 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