Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed #16683 -- Skip the IPv6 runserver tests if the platform doesn't…

… support it.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@17183 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 154438e315077e5cb95a6f34730b0eaf645d3ef6 1 parent 1a8b40c
@jezdez jezdez authored
Showing with 11 additions and 5 deletions.
  1. +11 −5 tests/regressiontests/admin_scripts/tests.py
View
16 tests/regressiontests/admin_scripts/tests.py
@@ -7,6 +7,7 @@
import os
import shutil
+import socket
import sys
import re
@@ -1056,10 +1057,13 @@ def test_app_with_import(self):
self.assertNoOutput(err)
self.assertOutput(out, '0 errors found')
+
class ManageRunserver(AdminScriptTestCase):
def setUp(self):
from django.core.management.commands.runserver import BaseRunserverCommand
- def monkey_run(*args, **options): return
+
+ def monkey_run(*args, **options):
+ return
self.cmd = BaseRunserverCommand()
self.cmd.run = monkey_run
@@ -1080,7 +1084,8 @@ def test_runserver_addrport(self):
self.cmd.handle(addrport="7000")
self.assertServerSettings('127.0.0.1', '7000')
- # IPv6
+ @unittest.skipUnless(socket.has_ipv6, 'markdown is installed')
+ def test_runner_addrport_ipv6(self):
self.cmd.handle(addrport="", use_ipv6=True)
self.assertServerSettings('::1', '8000', ipv6=True, raw_ipv6=True)
@@ -1090,18 +1095,19 @@ def test_runserver_addrport(self):
self.cmd.handle(addrport="[2001:0db8:1234:5678::9]:7000")
self.assertServerSettings('2001:0db8:1234:5678::9', '7000', ipv6=True, raw_ipv6=True)
- # Hostname
+ def test_runner_hostname(self):
self.cmd.handle(addrport="localhost:8000")
self.assertServerSettings('localhost', '8000')
self.cmd.handle(addrport="test.domain.local:7000")
self.assertServerSettings('test.domain.local', '7000')
+ @unittest.skipUnless(socket.has_ipv6, 'markdown is installed')
+ def test_runner_hostname_ipv6(self):
self.cmd.handle(addrport="test.domain.local:7000", use_ipv6=True)
self.assertServerSettings('test.domain.local', '7000', ipv6=True)
- # Potentially ambiguous
-
+ def test_runner_ambiguous(self):
# Only 4 characters, all of which could be in an ipv6 address
self.cmd.handle(addrport="beef:7654")
self.assertServerSettings('beef', '7654')
Please sign in to comment.
Something went wrong with that request. Please try again.