Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cubicweb
cubes
rqlcontroller
Commits
b363c13daa93
Commit
1c8cf830
authored
Sep 02, 2016
by
David Douard
Browse files
[test] port test to 3.19 API
And add a commit() during setUp.
parent
67f788249cfe
Changes
1
Hide whitespace changes
Inline
Side-by-side
test/unittest_rqlcontroller.py
View file @
b363c13d
# -*- coding: utf-8 -*-
# copyright 2013-2014 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# copyright 2013-2016 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr -- mailto:contact@logilab.fr
#
# This program is free software: you can redistribute it and/or modify it under
...
...
@@ -36,6 +35,7 @@ class RqlIOTc(CubicWebServerTC):
super
(
RqlIOTc
,
self
).
setUp
()
with
self
.
admin_access
.
client_cnx
()
as
cnx
:
self
.
create_user
(
cnx
,
u
'toto'
,
password
=
u
'toto'
)
cnx
.
commit
()
def
connectedRQLIOSession
(
self
,
login
=
'admin'
,
password
=
'gingkow'
):
rsession
=
requests
.
Session
()
...
...
@@ -86,9 +86,10 @@ class RqlIOTc(CubicWebServerTC):
rsession
=
self
.
connectedRQLIOSession
()
res
=
self
.
assertRQLPostOK
(
rsession
,
queries
)
self
.
assertEqual
(
'pachyderms'
,
self
.
execute
(
'Any N WHERE U in_group G, U login "Babar", '
'G name N'
).
rows
[
0
][
0
])
with
self
.
admin_access
.
client_cnx
()
as
cnx
:
self
.
assertEqual
(
'pachyderms'
,
cnx
.
execute
(
'String N WHERE U in_group G, U login "Babar", '
'G name N'
).
rows
[
0
][
0
])
output
=
[
x
for
x
,
in
res
.
json
()]
self
.
assertEqual
(
1
,
len
(
output
[
0
]))
self
.
assertEqual
(
1
,
len
(
output
[
1
]))
...
...
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