Mercurial > p > roundup > code
comparison test/test_userauditor.py @ 6237:0a37979bbd46
Verify , in username invalid; fix broken test
self.assertEqual was inside context hander. Should be outside.
So the test case wasn't actualy being checked.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Tue, 28 Jul 2020 05:51:00 -0400 |
| parents | 5148e46dd314 |
| children | 89aa919997c0 |
comparison
equal
deleted
inserted
replaced
| 6236:457a2eaa9848 | 6237:0a37979bbd46 |
|---|---|
| 105 def testBadUsernames(self): | 105 def testBadUsernames(self): |
| 106 ''' ky,le raises: | 106 ''' ky,le raises: |
| 107 ValueError: Username/Login Name must consist only of the letters a-z (any case), digits 0-9 and the symbols: @._-!+% | 107 ValueError: Username/Login Name must consist only of the letters a-z (any case), digits 0-9 and the symbols: @._-!+% |
| 108 ''' | 108 ''' |
| 109 | 109 |
| 110 for name in [ "ky'le", "ky<br>le" ]: | 110 for name in [ "ky'le", "ky<br>le", "ky,le" ]: |
| 111 with self.assertRaises(ValueError) as ctx: | 111 with self.assertRaises(ValueError) as ctx: |
| 112 self.db.user.create(username=name, | 112 self.db.user.create(username=name, |
| 113 address='kyle@example.com', | 113 address='kyle@example.com', |
| 114 realname='Kyle Broflovski', roles='User') | 114 realname='Kyle Broflovski', roles='User') |
| 115 self.assertEqual(str(ctx.exception), "Username/Login Name must " | 115 self.assertEqual(str(ctx.exception), "Username/Login Name must " |
| 116 "consist only of the letters a-z (any case), " | 116 "consist only of the letters a-z (any case), " |
| 117 "digits 0-9 and the symbols: @._-!%") | 117 "digits 0-9 and the symbols: @._-!+%") |
| 118 | 118 |
| 119 self.db.user.create(username='rouilj-1+mya_ddr@users.example.com', | 119 self.db.user.create(username='rouilj-1+mya_ddr@users.example.com', |
| 120 address='kyle1@example.com', | 120 address='kyle1@example.com', |
| 121 realname='Kyle Broflovski', roles='User') | 121 realname='Kyle Broflovski', roles='User') |
| 122 | 122 |
