Mercurial > p > roundup > code
comparison test/rest_common.py @ 5985:f1191a470598
Fix test to account for mixxing dicttoxml.
CI doesn't have dicttoxml installed. Make test pass with and without
it installed.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Tue, 26 Nov 2019 18:04:00 -0500 |
| parents | 25a813415d59 |
| children | 8b88fb789208 |
comparison
equal
deleted
inserted
replaced
| 5984:25a813415d59 | 5985:f1191a470598 |
|---|---|
| 1578 results = self.server.dispatch('DELETE', | 1578 results = self.server.dispatch('DELETE', |
| 1579 "/rest/data/issue/1issue:=asdf.jon", | 1579 "/rest/data/issue/1issue:=asdf.jon", |
| 1580 form) | 1580 form) |
| 1581 self.assertEqual(self.server.client.response_code, 406) | 1581 self.assertEqual(self.server.client.response_code, 406) |
| 1582 print(results) | 1582 print(results) |
| 1583 try: # only verify local copy not system installed copy | |
| 1584 from roundup.dicttoxml import dicttoxml | |
| 1585 includexml = ', application/xml' | |
| 1586 except ImportError: | |
| 1587 includexml = '' | |
| 1588 | |
| 1583 response="Requested content type 'jon' is not available.\n" \ | 1589 response="Requested content type 'jon' is not available.\n" \ |
| 1584 "Acceptable types: */*, application/json, application/xml\n" | 1590 "Acceptable types: */*, application/json%s\n"%includexml |
| 1585 self.assertEqual(results, response) | 1591 self.assertEqual(results, response) |
| 1586 | 1592 |
| 1587 # TEST #9 | 1593 # TEST #9 |
| 1588 # GET: test that version can be set with accept: | 1594 # GET: test that version can be set with accept: |
| 1589 # ... ; version=z | 1595 # ... ; version=z |
