server/test/data/migration/postcreate.py
author Sylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 01 Apr 2010 08:23:57 +0200
branchstable
changeset 5126 c869d8e7d166
parent 4252 6c4f109c2b03
child 5421 8167de96c523
permissions -rw-r--r--
[test] fix expected error
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1977
606923dff11b big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 0
diff changeset
     1
"""cubicweb post creation script, set note's workflow
606923dff11b big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 0
diff changeset
     2
606923dff11b big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 0
diff changeset
     3
:organization: Logilab
4212
ab6573088b4a update copyright: welcome 2010
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 3363
diff changeset
     4
:copyright: 2001-2010 LOGILAB S.A. (Paris, FRANCE), license is LGPL v2.
1977
606923dff11b big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 0
diff changeset
     5
:contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
606923dff11b big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 0
diff changeset
     6
:license: GNU Lesser General Public License, v2.1 - http://www.gnu.org/licenses
606923dff11b big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 0
diff changeset
     7
"""
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     8
3363
d3736311d0c4 update to 3.5 wf api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 1977
diff changeset
     9
wf = add_workflow(u'note workflow', 'Note')
d3736311d0c4 update to 3.5 wf api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 1977
diff changeset
    10
todo = wf.add_state(u'todo', initial=True)
d3736311d0c4 update to 3.5 wf api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 1977
diff changeset
    11
done = wf.add_state(u'done')
d3736311d0c4 update to 3.5 wf api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 1977
diff changeset
    12
wf.add_transition(u'redoit', done, todo)
d3736311d0c4 update to 3.5 wf api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 1977
diff changeset
    13
wf.add_transition(u'markasdone', todo, done)
4191
01638461d4b0 test update. All cw tests OK
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 3363
diff changeset
    14
commit()
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    15
3363
d3736311d0c4 update to 3.5 wf api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 1977
diff changeset
    16
wf = add_workflow(u'affaire workflow', 'Affaire')
d3736311d0c4 update to 3.5 wf api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 1977
diff changeset
    17
pitetre = wf.add_state(u'pitetre', initial=True)
d3736311d0c4 update to 3.5 wf api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 1977
diff changeset
    18
encours = wf.add_state(u'en cours')
d3736311d0c4 update to 3.5 wf api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 1977
diff changeset
    19
finie = wf.add_state(u'finie')
d3736311d0c4 update to 3.5 wf api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 1977
diff changeset
    20
bennon = wf.add_state(u'ben non')
d3736311d0c4 update to 3.5 wf api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 1977
diff changeset
    21
wf.add_transition(u'abort', pitetre, bennon)
d3736311d0c4 update to 3.5 wf api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 1977
diff changeset
    22
wf.add_transition(u'start', pitetre, encours)
d3736311d0c4 update to 3.5 wf api
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 1977
diff changeset
    23
wf.add_transition(u'end', encours, finie)
4191
01638461d4b0 test update. All cw tests OK
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 3363
diff changeset
    24
commit()
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    25