예제 #1
0
    def test_days_due_after_the_due_date(self, mock_now):
        mock_now.return_value = date(2015, 6, 1)
        lease = BookLeaseFactory()

        check = lease.days_due()

        self.assertEqual(6, check)
예제 #2
0
    def test_book_is_due_not_due(self, mock_now):
        mock_now.return_value = date(2015, 5, 23)
        lease = BookLeaseFactory()

        check = lease.book_is_due()

        self.assertEqual(None, check)
예제 #3
0
    def test_days_due_when_now_is_before_due(self, mock_now):
        mock_now.return_value = date(2015, 5, 21)
        lease = BookLeaseFactory()

        check = lease.days_due()

        self.assertEqual(5, check)
예제 #4
0
    def test_book_is_due_about(self, mock_now):
        mock_now.return_value = date(2015, 5, 25)
        lease = BookLeaseFactory()

        check = lease.book_is_due()

        self.assertEqual('about', check)
예제 #5
0
    def test_book_unicode_method_when_the_book_is_not_empty(self):
        book = BookLeaseFactory()

        title = book.__unicode__()

        self.assertEqual('String Theory', title)