Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mpasternak committed Feb 1, 2021
1 parent a860d20 commit f23898d
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/bpp/tests/test_selenium/test_raporty.py
Expand Up @@ -6,7 +6,6 @@
from django.urls import reverse

import pytest
from celeryui.models import Report

from bpp.tests.util import (
CURRENT_YEAR,
Expand All @@ -15,7 +14,7 @@
any_jednostka,
select_select2_autocomplete,
)

from celeryui.models import Report
from django_bpp.selenium_util import wait_for, wait_for_page_load


Expand Down Expand Up @@ -64,7 +63,16 @@ def test_ranking_autorow(raporty_browser, jednostka_raportow, asgi_live_server):
raporty_browser.visit(
asgi_live_server.url + reverse("bpp:ranking_autorow_formularz")
)
assert 'value="%s"' % (CURRENT_YEAR - 1) in raporty_browser.html
from django.utils import timezone

now = timezone.now()

if now.month < 2:
val = CURRENT_YEAR - 1
else:
val = CURRENT_YEAR

assert 'value="%s"' % val in raporty_browser.html


@pytest.mark.django_db(transaction=True)
Expand Down

0 comments on commit f23898d

Please sign in to comment.