1
0
forked from ScoDoc/ScoDoc
ScoDoc-Front/tests/unit/__init__.py

18 lines
431 B
Python
Raw Normal View History

# ScoDoc Unit Tests
"""Set of unit tests for ScoDoc
"""
def call_view(view_function, *args, **kwargs):
"""Undecorate a view and call it directly."""
# On a 3 décorateurs: @scodoc, @permission_required, @scodoc7func
func = (
view_function.__closure__[0]
.cell_contents.__closure__[0]
.cell_contents.__closure__[0]
.cell_contents
)
assert func
return func(*args, **kwargs)