test_users.py 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. from django.test.client import RequestFactory
  2. from django.urls import reverse
  3. from fixtures.apidocs_test_case import APIDocsTestCase
  4. from sentry.models import EventUser
  5. class ProjectUsersDocs(APIDocsTestCase):
  6. def setUp(self):
  7. self.project = self.create_project()
  8. self.euser1 = EventUser.objects.create(
  9. project_id=self.project.id,
  10. ident="1",
  11. email="foo@example.com",
  12. username="foobar",
  13. ip_address="127.0.0.1",
  14. )
  15. self.euser2 = EventUser.objects.create(
  16. project_id=self.project.id,
  17. ident="2",
  18. email="bar@example.com",
  19. username="baz",
  20. ip_address="192.168.0.1",
  21. )
  22. self.url = reverse(
  23. "sentry-api-0-project-users",
  24. kwargs={"organization_slug": self.organization.slug, "project_slug": self.project.slug},
  25. )
  26. self.login_as(user=self.user)
  27. def test_get(self):
  28. response = self.client.get(self.url)
  29. request = RequestFactory().get(self.url)
  30. self.validate_schema(request, response)