Mercurial > p > roundup > code
diff test/rest_common.py @ 5825:bcb894bc9740
Add test of protected values for collections and item.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Sun, 23 Jun 2019 21:21:51 -0400 |
| parents | ddb553d5618c |
| children | 9c6617857032 |
line wrap: on
line diff
--- a/test/rest_common.py Sun Jun 23 20:00:12 2019 -0400 +++ b/test/rest_common.py Sun Jun 23 21:21:51 2019 -0400 @@ -208,14 +208,17 @@ form = cgi.FieldStorage() form.list = [ cgi.MiniFieldStorage('status', 'open'), - cgi.MiniFieldStorage('@fields', 'nosy,status'), + cgi.MiniFieldStorage('@fields', 'nosy,status,creator'), cgi.MiniFieldStorage('@verbose', '2') ] expected={'data': {'@total_size': 3, - 'collection': [ - {'status': {'id': '9', + 'collection': [ { + 'creator': {'id': '3', + 'link': 'http://tracker.example/cgi-bin/roundup.cgi/bugs/rest/data/user/3', + 'username': 'joe'}, + 'status': {'id': '9', 'name': 'open', 'link': 'http://tracker.example/cgi-bin/roundup.cgi/bugs/rest/data/status/9'}, 'id': '1', @@ -229,7 +232,10 @@ ], 'link': 'http://tracker.example/cgi-bin/roundup.cgi/bugs/rest/data/issue/1', 'title': 'foo1' }, - {'status': { + { 'creator': {'id': '3', + 'link': 'http://tracker.example/cgi-bin/roundup.cgi/bugs/rest/data/user/3', + 'username': 'joe'}, + 'status': { 'id': '9', 'name': 'open', 'link': 'http://tracker.example/cgi-bin/roundup.cgi/bugs/rest/data/status/9' }, @@ -241,7 +247,10 @@ ], 'link': 'http://tracker.example/cgi-bin/roundup.cgi/bugs/rest/data/issue/2', 'title': 'foo2'}, - {'status': { + {'creator': {'id': '3', + 'link': 'http://tracker.example/cgi-bin/roundup.cgi/bugs/rest/data/user/3', + 'username': 'joe'}, + 'status': { 'id': '9', 'name': 'open', 'link': 'http://tracker.example/cgi-bin/roundup.cgi/bugs/rest/data/status/9'}, @@ -354,7 +363,7 @@ ## Start testing get_element form = cgi.FieldStorage() form.list = [ - cgi.MiniFieldStorage('@fields', 'queries,password'), + cgi.MiniFieldStorage('@fields', 'queries,password,creator'), cgi.MiniFieldStorage('@verbose', '2') ] expected = {'data': { @@ -363,6 +372,9 @@ '@etag': '', 'link': 'http://tracker.example/cgi-bin/roundup.cgi/bugs/rest/data/user/3', 'attributes': { + 'creator': {'id': '1', + 'link': 'http://tracker.example/cgi-bin/roundup.cgi/bugs/rest/data/user/1', + 'username': 'admin'}, 'password': '[password hidden scheme PBKDF2]', 'queries': [], 'username': 'joe'
