Skip to content

Heptapod: users registry now contains User instances

Georges Racinet requested to merge topic/stable/usersgeddon into branch/stable

This solves a discrepancy that has plagued the heptapod-tests code base for long.

In the beginning, users where represented as simple dicts, themselves kept in a registry: user attribute of the Heptapod instance. Then, more advanced manipulation needs pushed to the creation of the User class, but the user registry wasn't updated at the time.

The tricky part, explaining why it wasn't made right away is that we often start with a partial representation of the user: for instance not knowing its numeric id.

Over time some of the test code has been updated to use higher-level methods of the Heptapod class, such as get_user_webdriver(), in prevision for the present move, but still, the registry values remained at heart just dicts, while lots of needed logic is implemented in the User class.

Now we'll have User instances in the registry. That still leaves us with some illogical aspects, like lazy webdriver and token initialization indirected through the Heptapod class, instead of being transparent properties User. But from now on, improving on this should be incremental and involve identifiers easy to search in the code base.

Merge request reports