<feed xmlns='http://www.w3.org/2005/Atom'>
<title>gn-auth/tests/unit/auth/test_admin_users.py, branch main</title>
<subtitle>GN authentication and authorization service
</subtitle>
<id>http://git.genenetwork.org/gn-auth/atom?h=main</id>
<link rel='self' href='http://git.genenetwork.org/gn-auth/atom?h=main'/>
<link rel='alternate' type='text/html' href='http://git.genenetwork.org/gn-auth/'/>
<updated>2026-08-26T19:13:35+00:00</updated>
<entry>
<title>tests(admin): success-path tests for POST /auth/user/create</title>
<updated>2026-08-26T19:13:35+00:00</updated>
<author>
<name>Claude Sonnet 4.6</name>
</author>
<published>2026-08-26T17:36:38+00:00</published>
<link rel='alternate' type='text/html' href='http://git.genenetwork.org/gn-auth/commit/?id=d759cfa1aa60eb1096dc9c08e5d1d3428c2f7251'/>
<id>urn:sha1:d759cfa1aa60eb1096dc9c08e5d1d3428c2f7251</id>
<content type='text'>
Two TDD tests for the admin create-user endpoint success case:

- Valid admin token + valid body → 201
- Response body contains the new user's email and name

Both fail (501) until the endpoint body is implemented.

Co-Authored-By: Claude Sonnet 4.6 &lt;noreply@anthropic.com&gt;
Reviewed-By: Frederick M. Muriithi &lt;fredmanglis@gmail.com&gt;
</content>
</entry>
<entry>
<title>tests(admin): HTTP integration tests for POST /auth/user/create</title>
<updated>2026-08-26T16:43:05+00:00</updated>
<author>
<name>Claude Sonnet 4.6</name>
</author>
<published>2026-08-26T16:26:35+00:00</published>
<link rel='alternate' type='text/html' href='http://git.genenetwork.org/gn-auth/commit/?id=a90390053ccfbf66eaf6189074a99927d2dce8f0'/>
<id>urn:sha1:a90390053ccfbf66eaf6189074a99927d2dce8f0</id>
<content type='text'>
Two TDD tests that define the expected auth behaviour of the new
create-user endpoint before it is implemented:

- No Authorization header → 401
- Valid token for a non-admin user → 403

Both tests fail (404) until the endpoint exists.

Co-Authored-By: Claude Sonnet 4.6 &lt;noreply@anthropic.com&gt;
Reviewed-By: Frederick M. Muriithi &lt;fredmanglis@gmail.com&gt;

Add's aso a dummy endpoint.
</content>
</entry>
<entry>
<title>test(admin/users): failure path and credential-storage tests</title>
<updated>2026-08-26T15:31:46+00:00</updated>
<author>
<name>Claude</name>
</author>
<published>2026-08-26T15:27:12+00:00</published>
<link rel='alternate' type='text/html' href='http://git.genenetwork.org/gn-auth/commit/?id=7f516edda1f4eb082a8bce8574efabbc536edd05'/>
<id>urn:sha1:7f516edda1f4eb082a8bce8574efabbc536edd05</id>
<content type='text'>
Two additional unit tests for create_verified_user:

* test_create_verified_user_stores_credentials — asserts a password
  credential row is persisted in user_credentials after creation
* test_create_verified_user_raises_on_duplicate_email — asserts an
  exception is raised when the same email is registered twice (enforced
  by the UNIQUE constraint on users.email)

Co-Authored-By: Claude Sonnet 4.6 &lt;noreply@anthropic.com&gt;
Reviewed-By: Frederick M. Muriithi &lt;fredmanglis@gmail.com&gt;
</content>
</entry>
<entry>
<title>test(admin/users): unit tests for create_verified_user model function</title>
<updated>2026-08-26T15:15:06+00:00</updated>
<author>
<name>Claude</name>
</author>
<published>2026-08-26T14:53:18+00:00</published>
<link rel='alternate' type='text/html' href='http://git.genenetwork.org/gn-auth/commit/?id=04e3c7243e4754097749f88051d1589d75ed1cbf'/>
<id>urn:sha1:04e3c7243e4754097749f88051d1589d75ed1cbf</id>
<content type='text'>
Two unit tests for the (not yet implemented) create_verified_user function
in gn_auth.auth.authorisation.users.admin.models:

* test_create_verified_user_sets_verified_flag — asserts user.verified is
  True and the flag is persisted in the DB
* test_create_verified_user_has_no_roles — asserts no roles are assigned
  to the newly created user

Both tests use conn_after_auth_migrations to run against a fully migrated
SQLite test database.

Co-Authored-By: Claude Sonnet 4.6 &lt;noreply@anthropic.com&gt;
Reviewed-By: Frederick M. Muriithi &lt;fredmanglis@gmail.com&gt;
</content>
</entry>
</feed>
