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)
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)
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)
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)
def test_book_unicode_method_when_the_book_is_not_empty(self): book = BookLeaseFactory() title = book.__unicode__() self.assertEqual('String Theory', title)