import unittest

from datetime import date, timedelta

from calexicon.dates import DateWithCalendar


class TestDateWithCalendar(unittest.TestCase):
    def setUp(self):
        date_dt = date(2010, 8, 1)
        self.date_wc = DateWithCalendar(None, date_dt)

    def test_equality(self):
        self.assertTrue(self.date_wc != date(2010, 8, 1))

    def test_not_equal(self):
        """ Check that assertNotEqual works correctly.
            The main purpose of this test is to have code 
            coverage for the false branch of the 
            custom assertEqual. """
        self.assertNotEqual(self.date_wc, date(2010, 8, 1))

    def test_comparisons(self):
        self.assertTrue(self.date_wc < date(2010, 8, 2))
        self.assertFalse(self.date_wc < date(2010, 7, 31))
        self.assertTrue(self.date_wc > date(2010, 7, 2))
        self.assertFalse(self.date_wc > date(2010, 8, 31))

    def test_nonstrict_comparisons(self):
        self.assertTrue(self.date_wc <= date(2010, 8, 2))
        self.assertFalse(self.date_wc <= date(2010, 7, 31))
        self.assertTrue(self.date_wc >= date(2010, 7, 2))
        self.assertFalse(self.date_wc >= date(2010, 8, 31))
        self.assertTrue(self.date_wc <= date(2010, 8, 1))
        self.assertTrue(self.date_wc >= date(2010, 8, 1))

    def test_subtraction(self):
        self.assertEqual(self.date_wc - date(2012, 10, 30), timedelta(days=-821))

import unittest

from datetime import date, timedelta

from calexicon.dates import DateWithCalendar


class TestDateWithCalendar(unittest.TestCase):
    def setUp(self):
        date_dt = date(2010, 8, 1)
        self.date_wc = DateWithCalendar(None, date_dt)

    def test_equality(self):
        self.assertTrue(self.date_wc != date(2010, 8, 1))

    def test_not_equal(self):
        """ Check that assertNotEqual works correctly.
            The main purpose of this test is to have code
            coverage for the false branch of the
            custom assertEqual. """
        self.assertNotEqual(self.date_wc, date(2010, 8, 1))

    def test_comparisons(self):
        self.assertTrue(self.date_wc < date(2010, 8, 2))
        self.assertFalse(self.date_wc < date(2010, 7, 31))
        self.assertTrue(self.date_wc > date(2010, 7, 2))
        self.assertFalse(self.date_wc > date(2010, 8, 31))

    def test_nonstrict_comparisons(self):
        self.assertTrue(self.date_wc <= date(2010, 8, 2))
        self.assertFalse(self.date_wc <= date(2010, 7, 31))
        self.assertTrue(self.date_wc >= date(2010, 7, 2))
        self.assertFalse(self.date_wc >= date(2010, 8, 31))
        self.assertTrue(self.date_wc <= date(2010, 8, 1))
        self.assertTrue(self.date_wc >= date(2010, 8, 1))

    def test_subtraction(self):
        self.assertEqual(self.date_wc - date(2012, 10, 30), timedelta(days=-821))

Remove trailing spaces.