#137 Deployment: **Upgrade to Liquidsoap 2.4**: code has been adapted to work with liquidsoap 2.4 Co-authored-by: bkfox <thomas bkfox net> Reviewed-on: #138
40 lines
778 B
Python
40 lines
778 B
Python
import pytest
|
|
from model_bakery import baker
|
|
|
|
from aircox import models
|
|
|
|
|
|
class FakeView:
|
|
context = None
|
|
kwargs = {}
|
|
|
|
def ___init__(self):
|
|
self.kwargs = {}
|
|
|
|
def dispatch(self, *args, **kwargs):
|
|
pass
|
|
|
|
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
|