<s> from __future__ import unicode_literals <EOL> from django . utils import unittest <EOL> from django . utils . ipv6 import is_valid_ipv6_address , clean_ipv6_address <EOL> class TestUtilsIPv6 ( unittest . TestCase ) : <EOL> def test_validates_correct_plain_address ( self ) : <EOL> self . assertTrue ( is_valid_ipv6_address ( '<STR_LIT>' ) ) <EOL> self . assertTrue ( is_valid_ipv6_address ( '<STR_LIT>' ) ) <EOL> self . assertTrue ( is_valid_ipv6_address ( '<STR_LIT>' ) ) <EOL> self . assertTrue ( is_valid_ipv6_address ( '<STR_LIT>' ) ) <EOL> self . assertTrue ( is_valid_ipv6_address ( '<STR_LIT>' ) ) <EOL> self . assertTrue ( is_valid_ipv6_address ( '<STR_LIT>' ) ) <EOL> def test_validates_correct_with_v4mapping ( self ) : <EOL> self . assertTrue ( is_valid_ipv6_address ( '<STR_LIT>' ) ) <EOL> self . assertTrue ( is_valid_ipv6_address ( '<STR_LIT>' ) ) <EOL> def test_validates_incorrect_plain_address ( self ) : <EOL> self . assertFalse ( is_valid_ipv6_address ( '<STR_LIT:foo>' ) ) <EOL> self . assertFalse ( is_valid_ipv6_address ( '<STR_LIT:127.0.0.1>' ) ) <EOL> self . assertFalse ( is_valid_ipv6_address ( '<STR_LIT>' ) ) <EOL> self . assertFalse ( is_valid_ipv6_address ( '<STR_LIT>' ) ) <EOL> self . assertFalse ( is_valid_ipv6_address ( '<STR_LIT>' ) ) <EOL> self . assertFalse ( is_valid_ipv6_address ( '<STR_LIT>' ) ) <EOL> self . assertFalse ( is_valid_ipv6_address ( '<STR_LIT>' ) ) <EOL> self . assertFalse ( is_valid_ipv6_address ( '<STR_LIT>' ) ) <EOL> def test_validates_incorrect_with_v4mapping ( self ) : <EOL> self . assertFalse ( is_valid_ipv6_address ( '<STR_LIT>' ) ) <EOL> self . assertFalse ( is_valid_ipv6_address ( '<STR_LIT>' ) ) <EOL> self . assertTrue ( is_valid_ipv6_address ( '<STR_LIT>' ) ) <EOL> self . assertTrue ( is_valid_ipv6_address ( '<STR_LIT>' ) ) <EOL> self . assertFalse ( is_valid_ipv6_address ( '<STR_LIT>' ) ) <EOL> self . assertFalse ( is_valid_ipv6_address ( '<STR_LIT>' ) ) <EOL> def test_cleanes_plain_address ( self ) : <EOL> self . assertEqual ( clean_ipv6_address ( '<STR_LIT>' ) , '<STR_LIT>' ) <EOL> self . assertEqual ( clean_ipv6_address ( '<STR_LIT>' ) , '<STR_LIT>' ) <EOL> self . assertEqual ( clean_ipv6_address ( '<STR_LIT>' ) , '<STR_LIT>' ) <EOL> def test_cleanes_with_v4_mapping ( self ) : <EOL> self . assertEqual ( clean_ipv6_address ( '<STR_LIT>' ) , '<STR_LIT>' ) <EOL> self . assertEqual ( clean_ipv6_address ( '<STR_LIT>' ) , '<STR_LIT>' ) <EOL> self . assertEqual ( clean_ipv6_address ( '<STR_LIT>' ) , '<STR_LIT>' ) <EOL> def test_unpacks_ipv4 ( self ) : <EOL> self . assertEqual ( clean_ipv6_address ( '<STR_LIT>' , unpack_ipv4 = True ) , '<STR_LIT>' ) <EOL> self . assertEqual ( clean_ipv6_address ( '<STR_LIT>' , unpack_ipv4 = True ) , '<STR_LIT>' ) <EOL> self . assertEqual ( clean_ipv6_address ( '<STR_LIT>' , unpack_ipv4 = True ) , '<STR_LIT>' ) </s>
