test_project_similar_issues.py 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. from datetime import datetime
  2. from django.utils import timezone
  3. from sentry.testutils import AcceptanceTestCase
  4. from sentry.utils.samples import create_sample_event
  5. class ProjectIssuesGroupingTest(AcceptanceTestCase):
  6. def setUp(self):
  7. super().setUp()
  8. self.user = self.create_user("foo@example.com")
  9. self.org = self.create_organization(owner=self.user, name="Rowdy Tiger")
  10. self.org.flags.early_adopter = True
  11. self.org.save()
  12. self.team = self.create_team(organization=self.org, name="Mariachi Band")
  13. self.project = self.create_project(organization=self.org, teams=[self.team], name="Bengal")
  14. self.login_as(self.user)
  15. def create_sample_event(self, platform):
  16. event = create_sample_event(
  17. project=self.project,
  18. platform=platform,
  19. event_id="d964fdbd649a4cf8bfc35d18082b6b0e",
  20. timestamp=1452683305,
  21. )
  22. event.group.update(
  23. first_seen=datetime(2015, 8, 13, 3, 8, 25, tzinfo=timezone.utc),
  24. last_seen=datetime(2016, 1, 13, 3, 8, 25, tzinfo=timezone.utc),
  25. )
  26. return event