# Path: happenings/utils/displays.py
#     CALENDAR_LOCALE = str(getattr(settings, "CALENDAR_LOCALE", ""))
#         CALENDAR_LOCALE = str('en_US.UTF-8')
# def add_occurrences(events, count):
# def month_display(year, month, all_month_events,
#                   start_day, net, qs, mini=False, request=None, context=None):
# def day_display(year, month, all_month_events, day):


from calendar import month_name
from django.test import TestCase
from django.core.urlresolvers import reverse
from django.test.utils import override_settings
from django.utils import timezone
from django.utils import six
from .event_factory import create_event, SetMeUp
from happenings.utils import displays
                self.assertContains(response, event2.title)
                self.assertContains(response, HTML)
            else:
                self.assertNotContains(response, 'calendar-event')

    def test_list_view_incorrect_year_and_or_month_in_url(self):
        """
        A month < 01 should give 404, a month > 01 should redirect
        and display an error message.
        A year that is outside of the current year +/- 50 years
        should also redirect and display an error message.
        """
        message = "invalid"
        dates = {'2015': '00', '2015': '42', '1015': '01', '4015': '22'}
        for year, month in six.iteritems(dates):
            response = self.client.get(reverse(
                'calendar:list', kwargs={'year': year, 'month': month}
            ))
            self.assertContains(response, message)

    def test_list_view_calendar_starts_different_day(self):
        """Test that the calendar can start on different days."""
        # start on Monday
        cal = displays.month_display(
            2014, 3, [], 0, 0, ''
        )
        s = '</a></th></tr><tr><th class="mon">Mon</th><th class="tue"'
        self.assertIn(s, self.clean_whitespace(cal))

        # start on Sunday

# Path: happenings/utils/displays.py
#     CALENDAR_LOCALE = str(getattr(settings, "CALENDAR_LOCALE", ""))
#         CALENDAR_LOCALE = str('en_US.UTF-8')
# def add_occurrences(events, count):
# def month_display(year, month, all_month_events,
#                   start_day, net, qs, mini=False, request=None, context=None):
# def day_display(year, month, all_month_events, day):


# Path: tests/integration_tests/test_month_view.py
from calendar import month_name
from django.test import TestCase
from django.core.urlresolvers import reverse
from django.test.utils import override_settings
from django.utils import timezone
from django.utils import six
from .event_factory import create_event, SetMeUp
from happenings.utils import displays

                self.assertContains(response, event2.title)
                self.assertContains(response, HTML)
            else:
                self.assertNotContains(response, 'calendar-event')

    def test_list_view_incorrect_year_and_or_month_in_url(self):
        """
        A month < 01 should give 404, a month > 01 should redirect
        and display an error message.
        A year that is outside of the current year +/- 50 years
        should also redirect and display an error message.
        """
        message = "invalid"
        dates = {'2015': '00', '2015': '42', '1015': '01', '4015': '22'}
        for year, month in six.iteritems(dates):
            response = self.client.get(reverse(
                'calendar:list', kwargs={'year': year, 'month': month}
            ))
            self.assertContains(response, message)

    def test_list_view_calendar_starts_different_day(self):
        """Test that the calendar can start on different days."""
        # start on Monday
        cal = displays.month_display(
            2014, 3, [], 0, 0, ''
        )
        s = '</a></th></tr><tr><th class="mon">Mon</th><th class="tue"'
        self.assertIn(s, self.clean_whitespace(cal))

        # start on Sunday

        cal = displays.month_display(