From dd0951cc82ae9a89aff5e089e0002714f5ed21e6 Mon Sep 17 00:00:00 2001 From: Danielle McLean Date: Wed, 9 May 2018 21:36:21 +1000 Subject: [PATCH] Add tests for the Atom/RSS feeds so I won't accidentally break 'em without realising again --- entries/tests/__init__.py | 0 entries/tests/views/__init__.py | 0 entries/tests/views/feeds.py | 29 +++++++++++++++++++++++++++++ 3 files changed, 29 insertions(+) create mode 100644 entries/tests/__init__.py create mode 100644 entries/tests/views/__init__.py create mode 100644 entries/tests/views/feeds.py diff --git a/entries/tests/__init__.py b/entries/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/entries/tests/views/__init__.py b/entries/tests/views/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/entries/tests/views/feeds.py b/entries/tests/views/feeds.py new file mode 100644 index 0000000..21f6cab --- /dev/null +++ b/entries/tests/views/feeds.py @@ -0,0 +1,29 @@ +import pytest + + +@pytest.mark.django_db +def test_atom(client): + res = client.get('/atom') + assert res.status_code == 200 + assert res['Content-Type'] == 'application/atom+xml; charset=utf-8' + + +@pytest.mark.django_db +def test_rss(client): + res = client.get('/rss') + assert res.status_code == 200 + assert res['Content-Type'] == 'application/rss+xml; charset=utf-8' + + +@pytest.mark.django_db +def test_atom_by_kind(client): + res = client.get('/notes/atom') + assert res.status_code == 200 + assert res['Content-Type'] == 'application/atom+xml; charset=utf-8' + + +@pytest.mark.django_db +def test_rss_by_kind(client): + res = client.get('/notes/rss') + assert res.status_code == 200 + assert res['Content-Type'] == 'application/rss+xml; charset=utf-8'