diff options
author | Genki Sky <sky@genki.is> | 2018-04-21 21:59:10 -0400 |
---|---|---|
committer | Jelle van der Waa <jelle@vdwaa.nl> | 2018-04-22 19:39:33 +0200 |
commit | a33fd7e26594a72fa1e1a9c056cb17524f7c9363 (patch) | |
tree | f27bc69bb5ba934f3760457b89fdf4d7c7dec8b2 | |
parent | a0ce797dedf5e31c6354917c51b16efc1d0508c8 (diff) | |
download | archweb-a33fd7e26594a72fa1e1a9c056cb17524f7c9363.tar.gz archweb-a33fd7e26594a72fa1e1a9c056cb17524f7c9363.zip |
mirrorlist: Complete /all/https success test case
Also, remove test_generate(), as it was testing no more than
test_mirrorlist_filter() already was.
Signed-off-by: Genki Sky <sky@genki.is>
-rw-r--r-- | mirrors/tests/test_mirrorlist.py | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/mirrors/tests/test_mirrorlist.py b/mirrors/tests/test_mirrorlist.py index 1ad3d8d5..9e208125 100644 --- a/mirrors/tests/test_mirrorlist.py +++ b/mirrors/tests/test_mirrorlist.py @@ -25,9 +25,18 @@ class MirrorListTest(TestCase): self.assertIn(self.mirror_url.hostname, response.content) def test_mirrorlist_all_https(self): + # First test that without any https mirrors, we get a 404. response = self.client.get('/mirrorlist/all/https/') self.assertEqual(response.status_code, 404) - # TODO: test 200 case + + # Now, after adding an HTTPS mirror, we expect to succeed. + https_mirror_url = create_mirror_url( + name='https_mirror', + protocol='https', + url='https://wikipedia.org') + response = self.client.get('/mirrorlist/all/https/') + self.assertEqual(response.status_code, 200) + https_mirror_url.delete() def test_mirrorlist_filter(self): jp_mirror_url = create_mirror_url( @@ -45,8 +54,3 @@ class MirrorListTest(TestCase): self.assertNotIn(self.mirror_url.hostname, response.content) jp_mirror_url.delete() - - def test_generate(self): - response = self.client.get('/mirrorlist/?country=all&protocol=http&ip_version=4') - self.assertEqual(response.status_code, 200) - self.assertIn(self.mirror_url.hostname, response.content) |