Mercurial > p > roundup > code
comparison test/test_actions.py @ 5505:2ce41b8dffaf
compared sorted lists as order can be random
| author | Christof Meerwald <cmeerw@cmeerw.org> |
|---|---|
| date | Thu, 16 Aug 2018 21:14:07 +0100 |
| parents | 4f6e1ce89557 |
| children | f8893e1cde0d |
comparison
equal
deleted
inserted
replaced
| 5504:7f3dfdd6a620 | 5505:2ce41b8dffaf |
|---|---|
| 5 from roundup import hyperdb | 5 from roundup import hyperdb |
| 6 from roundup.date import Date, Interval | 6 from roundup.date import Date, Interval |
| 7 from roundup.cgi.actions import * | 7 from roundup.cgi.actions import * |
| 8 from roundup.cgi.client import add_message | 8 from roundup.cgi.client import add_message |
| 9 from roundup.cgi.exceptions import Redirect, Unauthorised, SeriousError, FormError | 9 from roundup.cgi.exceptions import Redirect, Unauthorised, SeriousError, FormError |
| 10 | |
| 11 from roundup.anypy.cmp_ import NoneAndDictComparable | |
| 10 | 12 |
| 11 from .mocknull import MockNull | 13 from .mocknull import MockNull |
| 12 | 14 |
| 13 def true(*args, **kwargs): | 15 def true(*args, **kwargs): |
| 14 return 1 | 16 return 1 |
| 415 ) | 417 ) |
| 416 try : | 418 try : |
| 417 self.action.handle() | 419 self.action.handle() |
| 418 except Redirect as msg: | 420 except Redirect as msg: |
| 419 pass | 421 pass |
| 420 self.assertEqual(expect, self.result) | 422 self.assertEqual(sorted(expect, key=NoneAndDictComparable), |
| 423 sorted(self.result, key=NoneAndDictComparable)) | |
| 421 | 424 |
| 422 def testFileAttach(self): | 425 def testFileAttach(self): |
| 423 expect = \ | 426 expect = \ |
| 424 [('create',(),{'content':'t','type':'text/plain','name':'t.txt'}) | 427 [('create',(),{'content':'t','type':'text/plain','name':'t.txt'}) |
| 425 ,('set',('4711',),{'files':['23','42','17']}) | 428 ,('set',('4711',),{'files':['23','42','17']}) |
