Mercurial > p > roundup > code
comparison test/test_cgi.py @ 4624:21705126dafa
Committed edited fix for issue2550712 by Cedric Krier.
| author | Bernhard Reiter <bernhard@intevation.de> |
|---|---|
| date | Mon, 14 May 2012 17:46:15 +0200 |
| parents | 4f9c3858b671 |
| children | 2f66d44616ad |
comparison
equal
deleted
inserted
replaced
| 4623:4f9c3858b671 | 4624:21705126dafa |
|---|---|
| 928 self.assertEquals('id,name\r\n1,unread\r\n2,deferred\r\n3,chatting\r\n' | 928 self.assertEquals('id,name\r\n1,unread\r\n2,deferred\r\n3,chatting\r\n' |
| 929 '4,need-eg\r\n5,in-progress\r\n6,testing\r\n7,done-cbb\r\n' | 929 '4,need-eg\r\n5,in-progress\r\n6,testing\r\n7,done-cbb\r\n' |
| 930 '8,resolved\r\n', | 930 '8,resolved\r\n', |
| 931 output.getvalue()) | 931 output.getvalue()) |
| 932 | 932 |
| 933 def testCSVExportBadColumnName(self): | |
| 934 cl = self._make_client({'@columns': 'falseid,name'}, nodeid=None, | |
| 935 userid='1') | |
| 936 cl.classname = 'status' | |
| 937 output = StringIO.StringIO() | |
| 938 cl.request = MockNull() | |
| 939 cl.request.wfile = output | |
| 940 self.assertRaises(exceptions.SeriousError, | |
| 941 actions.ExportCSVAction(cl).handle) | |
| 942 | |
| 933 def testCSVExportFailPermission(self): | 943 def testCSVExportFailPermission(self): |
| 934 cl = self._make_client({'@columns': 'id,email,password'}, nodeid=None, | 944 cl = self._make_client({'@columns': 'id,email,password'}, nodeid=None, |
| 935 userid='2') | 945 userid='2') |
| 936 cl.classname = 'user' | 946 cl.classname = 'user' |
| 937 output = StringIO.StringIO() | 947 output = StringIO.StringIO() |
| 938 cl.request = MockNull() | 948 cl.request = MockNull() |
| 939 cl.request.wfile = output | 949 cl.request.wfile = output |
| 940 self.assertRaises(exceptions.Unauthorised, | 950 # used to be self.assertRaises(exceptions.Unauthorised, |
| 951 # but not acting like the column name is not found | |
| 952 self.assertRaises(exceptions.SeriousError, | |
| 941 actions.ExportCSVAction(cl).handle) | 953 actions.ExportCSVAction(cl).handle) |
| 942 | 954 |
| 943 | 955 |
| 944 def test_suite(): | 956 def test_suite(): |
| 945 suite = unittest.TestSuite() | 957 suite = unittest.TestSuite() |
