Closed Aryamanz29 closed 1 year ago
I found that it's the conversion of a tuple to a set or vice versa that causes the random admin field order @nemesisdesign.
cb78d18
(#336)Similar post here : https://stackoverflow.com/questions/66575621/does-python-tupleset-maintains-order
test_copyablefields_admin_fields_order
) a few times, it gives me a different result each time: def test_copyablefields_admin_fields_order(self):
path = reverse('admin:test_project_project_add')
response = self.client.get(path)
ma = ProjectAdmin(Project, self.site)
# uuid should be missing in ma.get_fields
# because we're testing project admin add form
print(ma.fields, ma.get_fields(self.client.request))
print(ma.readonly_fields, ma.get_readonly_fields(self.client.request))
You may have noticed that we are receiving random admin field orders, as shown below. Therefore, if you remove this patch and run the new test case that I recently added in 5deafdb
(#336), it is possible that the test might pass instead of failing. This is because the set conversion behavior, which I already explained above.
Before
After
Fixes #335