forked from rc/aircox
cfr #121 Co-authored-by: Christophe Siraut <d@tobald.eu.org> Co-authored-by: bkfox <thomas bkfox net> Co-authored-by: Thomas Kairos <thomas@bkfox.net> Reviewed-on: rc/aircox#131 Co-authored-by: Chris Tactic <ctactic@noreply.git.radiocampus.be> Co-committed-by: Chris Tactic <ctactic@noreply.git.radiocampus.be>
This commit is contained in:
@ -40,7 +40,7 @@ def parent_mixin():
|
||||
@pytest.fixture
|
||||
def attach_mixin():
|
||||
class Mixin(mixins.AttachedToMixin, FakeView):
|
||||
attach_to_value = models.StaticPage.ATTACH_TO_HOME
|
||||
attach_to_value = models.StaticPage.Target.HOME
|
||||
|
||||
return Mixin()
|
||||
|
||||
@ -80,7 +80,7 @@ class TestGetDateMixin:
|
||||
)
|
||||
|
||||
def test_get_calls_get_date(self, date_mixin):
|
||||
date_mixin.get_date = lambda: today
|
||||
date_mixin.get_date = lambda *_: today
|
||||
date_mixin.get()
|
||||
assert date_mixin.date == today
|
||||
|
||||
@ -105,10 +105,10 @@ class TestParentMixin:
|
||||
def test_get_parent_not_parent_url_kwargs(self, parent_mixin):
|
||||
assert parent_mixin.get_parent(self.req) is None
|
||||
|
||||
def test_get_calls_parent(self, parent_mixin):
|
||||
def test_dispatch_calls_parent(self, parent_mixin):
|
||||
parent = "parent object"
|
||||
parent_mixin.get_parent = lambda *_, **kw: parent
|
||||
parent_mixin.get(self.req)
|
||||
parent_mixin.dispatch(self.req)
|
||||
assert parent_mixin.parent == parent
|
||||
|
||||
@pytest.mark.django_db
|
||||
@ -120,7 +120,7 @@ class TestParentMixin:
|
||||
assert set(query) == episodes_id
|
||||
|
||||
def test_get_context_data_with_parent(self, parent_mixin):
|
||||
parent_mixin.parent = Interface(cover="parent-cover")
|
||||
parent_mixin.parent = Interface(cover=Interface(url="parent-cover"))
|
||||
context = parent_mixin.get_context_data()
|
||||
assert context["cover"] == "parent-cover"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user