Make events tests deterministic
This commit is contained in:
parent
6fff995ccd
commit
707b7b76db
2 changed files with 14 additions and 18 deletions
|
@ -140,21 +140,17 @@ class CSVExportContentTest(MessagePatch, CSVResponseMixin, TestCase):
|
|||
)
|
||||
|
||||
response = self.client.get(self.url)
|
||||
content = self._load_from_csv_response(response, as_dict=True)
|
||||
toto_dict = dict(content[0])
|
||||
|
||||
# This is not super nice, but it makes the test deterministic.
|
||||
toto_dict["def"] = set(x.strip() for x in toto_dict["def"].split("&"))
|
||||
|
||||
self.assertDictEqual(
|
||||
toto_dict,
|
||||
{
|
||||
"username": "toto_foo",
|
||||
"prénom": "toto",
|
||||
"nom de famille": "foo",
|
||||
"email": "toto@a.b",
|
||||
"abc": "a",
|
||||
"def": {"d", "f"},
|
||||
"remarks": "hello",
|
||||
},
|
||||
self.assertCSVEqual(
|
||||
response,
|
||||
[
|
||||
{
|
||||
"username": "toto_foo",
|
||||
"prénom": "toto",
|
||||
"nom de famille": "foo",
|
||||
"email": "toto@a.b",
|
||||
"abc": "a",
|
||||
"def": "d & f",
|
||||
"remarks": "hello",
|
||||
}
|
||||
],
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue