Fix running the unit-tests
In de8a0a0635b722ae1f824b66b5674e58935617c5 we changed is_admin() to
rely on flask.g.authenticated instead of calling the function one more
time.
Except that this broke a few unit-tests and the API login which didn't
have this attribute on flask.g.
This commit fixes this.
Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>