summaryrefslogtreecommitdiffstats
path: root/tests/activities/views/test_timelines.py
blob: 6c8b355e9535c5bf0e4d1b317e59b4bf6c990e65 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import mock
import pytest

from activities.views.timelines import Home


@pytest.mark.django_db
def test_content_warning_text(identity, user, rf, config_system):
    request = rf.get("/")
    request.user = user
    request.identity = identity

    config_system.content_warning_text = "Content Summary"
    with mock.patch("core.models.Config.load_system", return_value=config_system):
        view = Home.as_view()
        resp = view(request)
        assert resp.status_code == 200
        assert 'placeholder="Content Summary"' in str(resp.rendered_content)