Ticket #15112: ticket15112.diff

File ticket15112.diff, 1.8 KB (added by Łukasz Rekucki, 14 years ago)

Same patch, but with tests.

  • django/core/management/commands/runserver.py

    diff --git a/django/core/management/commands/runserver.py b/django/core/management/commands/runserver.py
    index 55c7869..b265740 100644
    a b class BaseRunserverCommand(BaseCommand):  
    6363                    raise CommandError('"%s" is not a valid IPv6 address.' % self.addr)
    6464        if not self.addr:
    6565            self.addr = self.use_ipv6 and '::1' or '127.0.0.1'
     66            self._raw_ipv6 = bool(self.use_ipv6)
    6667        self.run(*args, **options)
    6768
    6869    def run(self, *args, **options):
  • tests/regressiontests/admin_scripts/tests.py

    diff --git a/tests/regressiontests/admin_scripts/tests.py b/tests/regressiontests/admin_scripts/tests.py
    index ae37eb3..87a6877 100644
    a b class ManageRunserver(AdminScriptTestCase):  
    10251025
    10261026        # IPv6
    10271027        self.cmd.handle(addrport="", use_ipv6=True)
    1028         self.assertServerSettings('::1', '8000', ipv6=True)
     1028        self.assertServerSettings('::1', '8000', ipv6=True, raw_ipv6=True)
    10291029
    10301030        self.cmd.handle(addrport="7000", use_ipv6=True)
    1031         self.assertServerSettings('::1', '7000', ipv6=True)
     1031        self.assertServerSettings('::1', '7000', ipv6=True, raw_ipv6=True)
    10321032
    10331033        self.cmd.handle(addrport="[2001:0db8:1234:5678::9]:7000")
    10341034        self.assertServerSettings('2001:0db8:1234:5678::9', '7000', ipv6=True, raw_ipv6=True)
    class ManageRunserver(AdminScriptTestCase):  
    10451045
    10461046        # Potentially ambiguous
    10471047
    1048         # Only 4 characters, all of which coudl be in an ipv6 address
     1048        # Only 4 characters, all of which could be in an ipv6 address
    10491049        self.cmd.handle(addrport="beef:7654")
    10501050        self.assertServerSettings('beef', '7654')
    10511051
Back to Top