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
Exemple #2
0
 def consultation_end_display(self):
     return get_date_display(self.consultation_end)
Exemple #3
0
 def consultation_start_display(self):
     return get_date_display(self.consultation_start)
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)
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)