Bump version to 1.3.6 and update NEWS.rst for 1.3.5
[mailman-postorious.git] / src / postorius / tests / test_utils.py
blobb6217e8b6058080ecfc5bdf7f88fbe69e57630b9
1 # -*- coding: utf-8 -*-
2 # Copyright (C) 2017-2021 by the Free Software Foundation, Inc.
4 # This file is part of Postorius.
6 # Postorius is free software: you can redistribute it and/or modify it under
7 # the terms of the GNU General Public License as published by the Free
8 # Software Foundation, either version 3 of the License, or (at your option)
9 # any later version.
11 # Postorius is distributed in the hope that it will be useful, but WITHOUT
12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 # more details.
16 # You should have received a copy of the GNU General Public License along with
17 # Postorius. If not, see <http://www.gnu.org/licenses/>.
19 from django.test import RequestFactory, TestCase
21 from postorius.utils import render_api_error
24 class TestUtils(TestCase):
26 def setUp(self):
27 self.factory = RequestFactory()
29 def test_render_api_error_works(self):
30 request = self.factory.get('/postorius/lists')
31 response = render_api_error(request)
32 self.assertTrue('Mailman REST API not available.' in
33 str(response.content))
34 self.assertEqual(response.status_code, 503)