misc: move api tests
This commit is contained in:
parent
355a9090d8
commit
e8acd48cc0
|
@ -7,6 +7,7 @@ import pytest
|
|||
from django.core.management import get_commands
|
||||
from django.core.management import call_command
|
||||
from django.core.management.base import CommandError
|
||||
from quixote import get_publisher
|
||||
|
||||
from wcs.sql import cleanup_connection
|
||||
from wcs.formdef import FormDef
|
||||
|
@ -15,7 +16,6 @@ from wcs.fields import BoolField
|
|||
from utilities import clean_temporary_pub
|
||||
from utilities import create_temporary_pub
|
||||
from utilities import force_connections_close
|
||||
from test_api import local_user
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
@ -70,6 +70,17 @@ def pub(request):
|
|||
clean_temporary_pub()
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def local_user():
|
||||
get_publisher().user_class.wipe()
|
||||
user = get_publisher().user_class()
|
||||
user.name = 'Jean Darmette'
|
||||
user.email = 'jean.darmette@triffouilis.fr'
|
||||
user.name_identifiers = ['0123456789']
|
||||
user.store()
|
||||
return user
|
||||
|
||||
|
||||
def test_command_exists():
|
||||
assert 'convert_to_sql' in get_commands()
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ import pytest
|
|||
import time
|
||||
|
||||
import mock
|
||||
from quixote import get_publisher
|
||||
from quixote.http_request import Upload
|
||||
from wcs.qommon import force_str
|
||||
from wcs.qommon.template import Template
|
||||
|
@ -33,8 +34,6 @@ from wcs.wf.register_comment import JournalEvolutionPart
|
|||
|
||||
from utilities import create_temporary_pub, clean_temporary_pub
|
||||
|
||||
from test_api import local_user
|
||||
|
||||
|
||||
def pytest_generate_tests(metafunc):
|
||||
if 'pub' in metafunc.fixturenames:
|
||||
|
@ -73,6 +72,17 @@ def teardown_module(module):
|
|||
clean_temporary_pub()
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def local_user():
|
||||
get_publisher().user_class.wipe()
|
||||
user = get_publisher().user_class()
|
||||
user.name = 'Jean Darmette'
|
||||
user.email = 'jean.darmette@triffouilis.fr'
|
||||
user.name_identifiers = ['0123456789']
|
||||
user.store()
|
||||
return user
|
||||
|
||||
|
||||
def test_basic(pub):
|
||||
formdata = formdef.data_class()()
|
||||
substvars = formdata.get_substitution_variables()
|
||||
|
|
Loading…
Reference in New Issue