from datetime import date
from django.core.urlresolvers import reverse
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from django.utils import formats
from selenium import webdriver


class HomeNewVisitorTest(StaticLiveServerTestCase):

    def setUp(self):
        self.browser = webdriver.Firefox()
        self.browser.implicitly_wait(3)

    def tearDown(self):
        self.browser.quit()

    def get_full_url(self, namespace):
        return "{0}{1}".format(self.live_server_url, reverse(namespace))

    def test_home_title(self):
        self.browser.get(self.get_full_url("home"))
        self.assertIn("Alert", self.browser.title)

    def test_h1_css(self):
        self.browser.get(self.get_full_url("home"))
        h1 = self.browser.find_element_by_tag_name("h1")
        self.assertIn(h1.value_of_css_property(
            "color"), "rgba(200, 50, 255, 1)")

    def test_home_files(self):
        self.browser.get(self.live_server_url + "/robots.txt")
        self.assertNotIn("Not Found", self.browser.title)
        self.browser.get(self.live_server_url + "/humans.txt")
        self.assertNotIn("Not Found", self.browser.title)

    def test_localization(self):
        today = date.today()
        self.browser.get(self.get_full_url("home"))
        local_date = self.browser.find_element_by_id("local-date")
        self.assertEqual(formats.date_format(
            today, use_l10n=True), local_date.text)

@@ -675,17 +675,17 @@
 f test_h
-1
+2
 _css(sel
@@ -749,17 +749,17 @@
        h
-1
+2
  = self.
@@ -793,17 +793,17 @@
 _name(%22h
-1
+2
 %22)%0A     
@@ -820,17 +820,17 @@
 sertIn(h
-1
+2
 .value_o
@@ -877,20 +877,15 @@
 gba(
-20
 0, 
-5
 0, 
-255
+0
 , 1)
@@ -1095,32 +1095,32 @@
  %22/humans.txt%22)%0A
+
         self.ass
@@ -1165,284 +1165,4 @@
 le)%0A
-%0A    def test_localization(self):%0A        today = date.today()%0A        self.browser.get(self.get_full_url(%22home%22))%0A        local_date = self.browser.find_element_by_id(%22local-date%22)%0A        self.assertEqual(formats.date_format(%0A            today, use_l10n=True), local_date.text)%0A

Fix css and heading test also removed localization test as no longer required