Esempio n. 1
0
    def test_date_with_zero_hours(self):
        """Ensure a date with minutes but no hours is retuned as a datetime."""
        from sosbeacon.utils import format_datetime

        date = datetime(year=2012, month=8, day=30, hour=0, minute=13)
        encoded = format_datetime(date)
        self.assertEqual('08/30/12 00:13', encoded)
Esempio n. 2
0
    def test_date_with_zero_minutes(self):
        """Ensure a date with hours but no minutes is retuned as a datetime."""
        from sosbeacon.utils import format_datetime

        date = datetime(year=2012, month=8, day=30, hour=19, minute=0)
        encoded = format_datetime(date)
        self.assertEqual('08/30/12 19:00', encoded)
Esempio n. 3
0
    def test_date(self):
        """Ensure a date with no hours / minutes is retuned as a date."""
        from sosbeacon.utils import format_datetime

        date = datetime(year=2012, month=8, day=30)
        encoded = format_datetime(date)
        self.assertEqual('08/30/12', encoded)
Esempio n. 4
0
    def test_date_with_zero_minutes(self):
        """Ensure a date with hours but no minutes is retuned as a datetime."""
        from sosbeacon.utils import format_datetime

        date = datetime(year=2012, month=8, day=30, hour=19, minute=0)
        encoded = format_datetime(date)
        self.assertEqual('08/30/12 19:00', encoded)
Esempio n. 5
0
    def test_date_with_zero_hours(self):
        """Ensure a date with minutes but no hours is retuned as a datetime."""
        from sosbeacon.utils import format_datetime

        date = datetime(year=2012, month=8, day=30, hour=0, minute=13)
        encoded = format_datetime(date)
        self.assertEqual('08/30/12 00:13', encoded)
Esempio n. 6
0
    def test_date(self):
        """Ensure a date with no hours / minutes is retuned as a date."""
        from sosbeacon.utils import format_datetime

        date = datetime(year=2012, month=8, day=30)
        encoded = format_datetime(date)
        self.assertEqual('08/30/12', encoded)
Esempio n. 7
0
    def test_non_input(self):
        """Ensure a missing date returns the empty string."""
        from sosbeacon.utils import format_datetime

        encoded = format_datetime(None)
        self.assertEqual('', encoded)
Esempio n. 8
0
    def test_non_input(self):
        """Ensure a missing date returns the empty string."""
        from sosbeacon.utils import format_datetime

        encoded = format_datetime(None)
        self.assertEqual('', encoded)