Tests: the order of our csv files is not relevant
This commit is contained in:
parent
ee33762845
commit
6328cdaa19
1 changed files with 7 additions and 2 deletions
|
@ -38,13 +38,18 @@ class ExportMembersViewTests(ViewTestCaseMixin, TestCase):
|
|||
|
||||
self.assertEqual(r.status_code, 200)
|
||||
data = list(csv.reader(r.content.decode('utf-8').split('\n')[:-1]))
|
||||
self.assertListEqual(data, [
|
||||
expected = [
|
||||
[
|
||||
str(u1.pk), 'member', 'first', 'last', 'user@mail.net',
|
||||
'0123456789', '1A', 'Dept', 'normalien',
|
||||
],
|
||||
[str(u2.pk), 'staff', '', '', '', '', '1A', '', 'normalien'],
|
||||
])
|
||||
]
|
||||
# Sort before checking equality, the order of the output of csv.reader
|
||||
# does not seem deterministic
|
||||
expected.sort(key=lambda row: int(row[0]))
|
||||
data.sort(key=lambda row: int(row[0]))
|
||||
self.assertListEqual(data, expected)
|
||||
|
||||
|
||||
class MegaHelpers:
|
||||
|
|
Loading…
Reference in a new issue