test_shortid.py 784 B

123456789101112131415161718192021222324252627
  1. from django.test.client import RequestFactory
  2. from django.urls import reverse
  3. from fixtures.apidocs_test_case import APIDocsTestCase
  4. from sentry.testutils.silo import region_silo_test
  5. @region_silo_test(stable=True)
  6. class OrganizationShortIDDocs(APIDocsTestCase):
  7. def setUp(self):
  8. group = self.create_group(project=self.project)
  9. self.url = reverse(
  10. "sentry-api-0-short-id-lookup",
  11. kwargs={
  12. "organization_slug": self.organization.slug,
  13. "short_id": group.qualified_short_id,
  14. },
  15. )
  16. self.login_as(user=self.user)
  17. def test_get(self):
  18. response = self.client.get(self.url)
  19. request = RequestFactory().get(self.url)
  20. self.validate_schema(request, response)