ó
K~Pc           @  s   d  d l  m Z d  d l m Z d  d l m Z d d l m Z d e f d     YZ e d e	  d	 e f d
     Y Z
 d S(   i˙˙˙˙(   t   unicode_literals(   t   date(   t   override_settingsi   (   t   SitemapTestsBaset   HTTPSSitemapTestsc           B  s&   e  Z d  Z d Z d   Z d   Z RS(   u   httpsu(   django.contrib.sitemaps.tests.urls.httpsc         C  s?   |  j  j d  } d |  j } |  j | j j d  |  d S(   u&   A secure sitemap index can be renderedu   /secure/index.xmluľ   <?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap><loc>%s/secure/sitemap-simple.xml</loc></sitemap>
</sitemapindex>
u   utf-8N(   t   clientt   gett   base_urlt   assertXMLEqualt   contentt   decode(   t   selft   responset   expected_content(    (    s<   ../Django//lib/python/django/contrib/sitemaps/tests/https.pyt   test_secure_sitemap_index   s    c         C  sK   |  j  j d  } d |  j t j   f } |  j | j j d  |  d S(   u(   A secure sitemap section can be renderedu   /secure/sitemap-simple.xmluÜ   <?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url><loc>%s/location/</loc><lastmod>%s</lastmod><changefreq>never</changefreq><priority>0.5</priority></url>
</urlset>
u   utf-8N(   R   R   R   R   t   todayR   R	   R
   (   R   R   R   (    (    s<   ../Django//lib/python/django/contrib/sitemaps/tests/https.pyt   test_secure_sitemap_section   s    (   t   __name__t
   __module__t   protocolt   urlsR   R   (    (    (    s<   ../Django//lib/python/django/contrib/sitemaps/tests/https.pyR   	   s   	
t   SECURE_PROXY_SSL_HEADERt   HTTPSDetectionSitemapTestsc           B  s'   e  Z i d  d 6Z d   Z d   Z RS(   u   httpsu   wsgi.url_schemec         C  sQ   |  j  j d |  j  } d |  j j d d  } |  j | j j d  |  d S(   u?   A sitemap index requested in HTTPS is rendered with HTTPS linksu   /simple/index.xmluľ   <?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap><loc>%s/simple/sitemap-simple.xml</loc></sitemap>
</sitemapindex>
u   http://u   https://u   utf-8N(   R   R   t   extraR   t   replaceR   R	   R
   (   R   R   R   (    (    s<   ../Django//lib/python/django/contrib/sitemaps/tests/https.pyt%   test_sitemap_index_with_https_request&   s    c         C  s]   |  j  j d |  j  } d |  j j d d  t j   f } |  j | j j	 d  |  d S(   uA   A sitemap section requested in HTTPS is rendered with HTTPS linksu   /simple/sitemap-simple.xmluÜ   <?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url><loc>%s/location/</loc><lastmod>%s</lastmod><changefreq>never</changefreq><priority>0.5</priority></url>
</urlset>
u   http://u   https://u   utf-8N(
   R   R   R   R   R   R   R   R   R	   R
   (   R   R   R   (    (    s<   ../Django//lib/python/django/contrib/sitemaps/tests/https.pyt'   test_sitemap_section_with_https_request0   s    %(   R   R   R   R   R   (    (    (    s<   ../Django//lib/python/django/contrib/sitemaps/tests/https.pyR   "   s   	
N(   t
   __future__R    t   datetimeR   t   django.test.utilsR   t   baseR   R   t   FalseR   (    (    (    s<   ../Django//lib/python/django/contrib/sitemaps/tests/https.pyt   <module>   s   