def test_consultation_closing_date(review_in_consultation, django_app):
    """
    Test the closing date is shown for a review in the consultation phase.
    """
    policy = review_in_consultation.policies.first()
    page = django_app.get(policy.get_public_url())
    date = get_date_display(review_in_consultation.consultation_end)
    assert str(_("Closing date: %s" % date)) in page
コード例 #2
0
 def consultation_end_display(self):
     return get_date_display(self.consultation_end)
コード例 #3
0
 def consultation_start_display(self):
     return get_date_display(self.consultation_start)
コード例 #4
0
def test_get_date_display__date_cannot_be_none():
    """
    Test a ValueError is raised if the date is None.
    """
    assert "2nd January 2020" == get_date_display(date(2020, 1, 2))
    pytest.raises(ValueError, get_date_display, None)
コード例 #5
0
def test_get_date_display__date_is_formatted():
    """
    Test a suffix is added to the day in a month.
    """
    assert "2nd January 2020" == get_date_display(date(2020, 1, 2))
    pytest.raises(ValueError, get_date_display, None)