Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cubicweb
cubes
seda
Commits
1c4456729955
Commit
c9e162f4
authored
Mar 29, 2017
by
Sylvain Thénault
Browse files
[test] Import module instead of names
will be easier to use another function from this module.
parent
a88deb387b2b
Changes
1
Hide whitespace changes
Inline
Side-by-side
test/test_hooks.py
View file @
1c445672
...
...
@@ -20,7 +20,7 @@ from itertools import chain, repeat
from
cubicweb
import
ValidationError
from
cubicweb.devtools.testlib
import
CubicWebTC
from
testutils
import
create_transfer_to_bdo
,
create_archive_unit
,
scheme_for_type
import
testutils
class
ValidationHooksTC
(
CubicWebTC
):
...
...
@@ -35,7 +35,7 @@ class ValidationHooksTC(CubicWebTC):
reuse_concept
=
reuse_scheme
.
add_concept
(
label
=
u
'share-alike'
)
cnx
.
commit
()
bdo
=
create_transfer_to_bdo
(
cnx
)
bdo
=
testutils
.
create_transfer_to_bdo
(
cnx
)
transfer
=
bdo
.
container
[
0
]
create
(
'SEDAAccessRuleCodeListVersion'
,
seda_access_rule_code_list_version_from
=
transfer
,
...
...
@@ -140,7 +140,7 @@ class SetDefaultHooksTC(CubicWebTC):
(
'seda_rule'
,
'SEDASeqAppraisalRuleRule'
),
(
'seda_rule'
,
'SEDASeqAccessRuleRule'
),
(
'seda_rule'
,
'SEDASeqDisseminationRuleRule'
)]):
scheme_for_type
(
cnx
,
rtype
,
etype
)
testutils
.
scheme_for_type
(
cnx
,
rtype
,
etype
)
cnx
.
commit
()
transfer
=
cnx
.
create_entity
(
'SEDAArchiveTransfer'
,
title
=
u
'test profile'
)
cnx
.
commit
()
...
...
@@ -160,7 +160,7 @@ class SetDefaultHooksTC(CubicWebTC):
"""
with
self
.
admin_access
.
client_cnx
()
as
cnx
:
transfer
=
cnx
.
create_entity
(
'SEDAArchiveTransfer'
,
title
=
u
'test profile'
)
unit
,
unit_alt
,
unit_alt_seq
=
create_archive_unit
(
transfer
)
unit
,
unit_alt
,
unit_alt_seq
=
testutils
.
create_archive_unit
(
transfer
)
version_of
=
cnx
.
create_entity
(
'SEDAIsVersionOf'
,
seda_is_version_of
=
unit_alt_seq
)
alt2
=
cnx
.
create_entity
(
'SEDAAltIsVersionOfArchiveUnitRefId'
,
reverse_seda_alt_is_version_of_archive_unit_ref_id
=
version_of
)
...
...
@@ -175,7 +175,7 @@ class CheckProfileTC(CubicWebTC):
def
test_base
(
self
):
with
self
.
admin_access
.
repo_cnx
()
as
cnx
:
transfer
=
cnx
.
create_entity
(
'SEDAArchiveTransfer'
,
title
=
u
'diagnosis testing'
)
unit
,
unit_alt
,
unit_alt_seq
=
create_archive_unit
(
transfer
)
unit
,
unit_alt
,
unit_alt_seq
=
testutils
.
create_archive_unit
(
transfer
)
access_rule
=
cnx
.
create_entity
(
'SEDAAccessRule'
,
seda_access_rule
=
unit_alt_seq
)
cnx
.
commit
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment