Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 5
0
    def test_book_unicode_method_when_the_book_is_not_empty(self):
        book = BookLeaseFactory()

        title = book.__unicode__()

        self.assertEqual('String Theory', title)