2 # This file is part of my.gpodder.org.
4 # my.gpodder.org is free software: you can redistribute it and/or modify it
5 # under the terms of the GNU Affero General Public License as published by
6 # the Free Software Foundation, either version 3 of the License, or (at your
7 # option) any later version.
9 # my.gpodder.org is distributed in the hope that it will be useful, but
10 # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
11 # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
12 # License for more details.
14 # You should have received a copy of the GNU Affero General Public License
15 # along with my.gpodder.org. If not, see <http://www.gnu.org/licenses/>.
21 from django
.test
import TestCase
22 from django
.core
.urlresolvers
import reverse
24 import mygpo
.web
.utils
25 from mygpo
.test
import create_auth_string
28 class SimpleWebTests(TestCase
):
30 self
.user
, _
= User
.objects
.get_or_create(username
='test')
31 self
.user
.set_password('pwd')
34 self
.auth_string
= create_auth_string('test', 'pwd')
36 def test_access_parameterless_pages(self
):
44 'subscriptions-download',
58 self
.access_pages(pages
, [], True)
60 def test_access_podcast_pages(self
):
63 def access_pages(self
, pages
, args
, login
):
65 self
.client
.post('/login/', dict(
66 login_username
=self
.user
.username
, pwd
='pwd'))
69 response
= self
.client
.get(reverse(page
, args
=args
), follow
=True)
70 self
.assertEquals(response
.status_code
, 200)
74 suite
= unittest
.TestSuite()
75 suite
.addTest(doctest
.DocTestSuite(mygpo
.web
.utils
))
76 suite
.addTest(unittest
.TestLoader().loadTestsFromTestCase(SimpleWebTests
))