Bump version to 1.3.6 and update NEWS.rst for 1.3.5
[mailman-postorious.git] / src / postorius / tests / test_urls.py
blobbf547280872f9cd1f27982d5f4052dbbbbe04067
1 # -*- coding: utf-8 -*-
2 # Copyright (C) 2016-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.
10 # Postorius is distributed in the hope that it will be useful, but WITHOUT
11 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 # more details.
15 # You should have received a copy of the GNU General Public License along with
16 # Postorius. If not, see <http://www.gnu.org/licenses/>.
19 from django.test import TestCase
20 from django.urls import NoReverseMatch, reverse
23 class URLTest(TestCase):
25 def test_email_allows_slash(self):
26 try:
27 reverse('list_member_options', kwargs={
28 'list_id': 'test.example.com',
29 'email': 'slashed/are/allowed@example.com',
31 reverse('remove_role', kwargs={
32 'list_id': 'test.example.com',
33 'role': 'subscriber',
34 'address': 'slashed/are/allowed@example.com',
36 except NoReverseMatch as e:
37 self.fail(e)
39 def test_held_message_url_ends_with_slash(self):
40 url = reverse('rest_held_message', args=('foo', 0))
41 self.assertEqual(url[-2:], '0/')