Skip to content

add test option to check if variables in template tags are defined #506

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 42 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
e99c1ae
first commit
Atanazyy Dec 16, 2024
75a0fc2
Merge branch 'sio2project:master' into master
Atanazyy Dec 16, 2024
bcd30a3
fix permissions
Atanazyy Dec 16, 2024
d96ba08
fix admin panel not saving
Atanazyy Dec 22, 2024
d367490
small fixes
Atanazyy Dec 22, 2024
47ff36b
fix origin info
Atanazyy Dec 22, 2024
170aff1
change permission name
Atanazyy Dec 27, 2024
4bf9145
fix permissions for contest admins
Atanazyy Dec 27, 2024
d5b72ef
fix permissions for contest admins
Atanazyy Dec 27, 2024
a152009
fix for problems without contests
Atanazyy Dec 27, 2024
232f7e5
add test
Atanazyy Jan 13, 2025
3a07a62
resolve conflicts
Atanazyy Jan 13, 2025
715e27d
Merge remote-tracking branch 'masterremote/master'
Atanazyy Jan 13, 2025
39d5c02
small fix
Atanazyy Jan 13, 2025
15abb1d
test tags tab
Atanazyy Jan 19, 2025
56ca6cc
squash migrations
Atanazyy Jan 20, 2025
f250a64
remove redundant migrations
Atanazyy Jan 20, 2025
1674dba
Merge branch 'master' into master
Atanazyy Jan 20, 2025
ebf7bf2
Merge branch 'sio2project:master' into master
Atanazyy Feb 26, 2025
ec2dc69
Merge branch 'sio2project:master' into master
Atanazyy Feb 26, 2025
8df28ed
display nickname next to the full name when displaying contest pupils
Atanazyy Feb 26, 2025
f612e8b
add logic and use member.username
Atanazyy Mar 5, 2025
27e257c
fix more similar cases
Atanazyy Mar 5, 2025
bf63ecf
fix order of names
Atanazyy Mar 6, 2025
26e48c5
more elegant code
Atanazyy Mar 12, 2025
0d13af7
more elegant code
Atanazyy Mar 12, 2025
776f61c
revert changes
Atanazyy Mar 12, 2025
a0f86fb
more elegant code
Atanazyy Mar 12, 2025
12e665c
Merge branch 'sio2project:master' into master
Atanazyy Mar 19, 2025
d0558cd
Merge branch 'sio2project:master' into master
Atanazyy Mar 25, 2025
34edc91
add buttons to expand group member lists
Atanazyy Mar 25, 2025
777c004
Merge branch 'sio2project:master' into master
Atanazyy Mar 26, 2025
dfdc54b
Merge branch 'sio2project:master' into master
Atanazyy Apr 2, 2025
ae9d7d2
fix minor bugs
Atanazyy Apr 2, 2025
9590f5c
add tests
Atanazyy Apr 2, 2025
9825a2d
Merge branch 'sio2project:master' into master
Atanazyy Apr 11, 2025
1c1e573
add test option to check if variables in template tags are defined
Atanazyy Apr 16, 2025
4238d62
code style
Atanazyy Apr 16, 2025
9dcbcfd
better approach
Atanazyy Apr 16, 2025
67f2dc7
better approach
Atanazyy Apr 16, 2025
3afd0c0
cleaner code
Atanazyy Apr 16, 2025
d8c58e2
Merge branch 'sio2project:master' into master
Atanazyy Apr 23, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@

from oioioi.base.tests import pytest_plugin as base_plugin
from oioioi.contests.tests import pytest_plugin as contests_plugin
from django.conf import settings


def pytest_addoption(parser):
parser.addoption(
'--runslow', action='store_true', default=False, help="run slow tests"
)
parser.addoption(
'--strict-template-vars', action='store_true', help="Raise errors for undefined template variables")


# called for running each test
Expand All @@ -18,6 +21,12 @@ def pytest_runtest_setup(item):
base_plugin.pytest_runtest_setup(item)


def pytest_configure(config):
if config.getoption("--strict-template-vars"):
# this will raise an error if a template variable is not defined
settings.TEMPLATES[0]['OPTIONS']['string_if_invalid'] = '{% templatetag openvariable %} INVALID_VAR: %s {% templatetag closevariable %}'


def pytest_collection_modifyitems(config, items):
# --runslow flag: do not skip slow tests
if config.getoption('--runslow', False):
Expand Down