def test_will_filter_for_january(self):
        start_of_january = workhours.build_from_date(datetime(2014, 1, 1))
        hours = [start_of_january]

        result = hours_filtering.filter_by__current_worksheet_month(datetime(2014, 1, 1), hours)

        assert start_of_january in result
Ejemplo n.º 2
0
    def test_will_filter_for_january(self):
        start_of_january = workhours.build_from_date(datetime(2014, 1, 1))
        hours = [start_of_january]

        result = hours_filtering.filter_by__current_worksheet_month(
            datetime(2014, 1, 1), hours)

        assert start_of_january in result
    def test_will_filter_dates_based_on_worksheet_months(self):
        previousmonth = workhours.build_from_date(datetime(2013, 2, 28))
        previousworksheetmonth = workhours.build_from_date(datetime(2013, 3, 15))
        worksheetmonthstartdate = workhours.build_from_date(datetime(2013, 3, 26))
        nextworksheetmonthdate = workhours.build_from_date(datetime(2013, 4, 1))
        nextcalendarmonth = workhours.build_from_date(datetime(2013, 5, 2))

        hours = [previousmonth,
                previousworksheetmonth,
                worksheetmonthstartdate,
                nextworksheetmonthdate,
                nextcalendarmonth]

        result = hours_filtering.filter_by__current_worksheet_month(datetime(2013, 3, 27), hours)

        assert worksheetmonthstartdate in result
        assert previousworksheetmonth in result
        assert previousmonth not in result
        assert nextcalendarmonth not in result
Ejemplo n.º 4
0
    def test_will_filter_dates_based_on_worksheet_months(self):
        previousmonth = workhours.build_from_date(datetime(2013, 2, 28))
        previousworksheetmonth = workhours.build_from_date(
            datetime(2013, 3, 15))
        worksheetmonthstartdate = workhours.build_from_date(
            datetime(2013, 3, 26))
        nextworksheetmonthdate = workhours.build_from_date(datetime(
            2013, 4, 1))
        nextcalendarmonth = workhours.build_from_date(datetime(2013, 5, 2))

        hours = [
            previousmonth, previousworksheetmonth, worksheetmonthstartdate,
            nextworksheetmonthdate, nextcalendarmonth
        ]

        result = hours_filtering.filter_by__current_worksheet_month(
            datetime(2013, 3, 27), hours)

        assert worksheetmonthstartdate in result
        assert previousworksheetmonth in result
        assert previousmonth not in result
        assert nextcalendarmonth not in result