sentry icon indicating copy to clipboard operation
sentry copied to clipboard

Add test for org auth token last used date always being updated

Open szokeasaurusrex opened this issue 1 year ago • 2 comments

[It] would be good to have a test for this to prevent regressions in the future.

Originally posted by @markstory in https://github.com/getsentry/sentry/pull/67147#pullrequestreview-1943581861

szokeasaurusrex avatar Apr 02 '24 12:04 szokeasaurusrex

Hey @markstory, I was wondering if you have any pointers for how to write this test. I had asked on the PR where you requested the test, but maybe you missed that comment since the PR was closed shortly afterwards.

szokeasaurusrex avatar Aug 06 '24 14:08 szokeasaurusrex

I did miss that comment sorry. I generally skip over reading updates on closed pull requests. As for writing a test, we have a few tests for the release endpoints. These endpoints include explicit calls to update_org_auth_token_last_used. An example of an existing test is https://github.com/getsentry/sentry/blob/ee63085600c34fd4c33b1b9d7983456add3acf42/tests/sentry/api/endpoints/test_organization_releases.py#L1888-L1892

We could have similar tests for a non-release endpoint + orgauth token request.

markstory avatar Aug 09 '24 17:08 markstory