Skip to content

Commit 4e232d8

Browse files
author
Joshua Li
committed
remove compat branching for older django versions
1 parent 240ba95 commit 4e232d8

File tree

2 files changed

+6
-13
lines changed

2 files changed

+6
-13
lines changed

tests/sentry/api/endpoints/test_organization_searches.py

+6-9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from __future__ import absolute_import
22

3-
import django
43
from django.utils import timezone
54
from exam import fixture
65

@@ -24,10 +23,9 @@ def test_simple(self):
2423
project1 = self.create_project(teams=[team], name="foo")
2524
project2 = self.create_project(teams=[team], name="bar")
2625

27-
if django.VERSION[:2] >= (1, 8):
28-
# Depending on test we run migrations in Django 1.8. This causes
29-
# extra rows to be created, so remove them to keep this test working
30-
SavedSearch.objects.filter(is_global=True).delete()
26+
# Depending on test we run migrations in Django 1.8. This causes
27+
# extra rows to be created, so remove them to keep this test working
28+
SavedSearch.objects.filter(is_global=True).delete()
3129

3230
SavedSearch.objects.create(
3331
project=project1, name="bar", query=DEFAULT_SAVED_SEARCHES[0]["query"]
@@ -71,10 +69,9 @@ def get_response(self, *args, **params):
7169
return super(OrgLevelOrganizationSearchesListTest, self).get_response(*args, **params)
7270

7371
def create_base_data(self):
74-
if django.VERSION[:2] >= (1, 8):
75-
# Depending on test we run migrations in Django 1.8. This causes
76-
# extra rows to be created, so remove them to keep this test working
77-
SavedSearch.objects.filter(is_global=True).delete()
72+
# Depending on test we run migrations in Django 1.8. This causes
73+
# extra rows to be created, so remove them to keep this test working
74+
SavedSearch.objects.filter(is_global=True).delete()
7875

7976
team = self.create_team(members=[self.user])
8077
SavedSearch.objects.create(

tests/sentry/api/endpoints/test_project_details.py

-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import mock
44
import six
55

6-
import django
76
from django.core.urlresolvers import reverse
87

98
from sentry.constants import RESERVED_PROJECT_SLUGS
@@ -82,9 +81,6 @@ def test_project_renamed_302(self):
8281
"foobar",
8382
)
8483
redirect_path = "/api/0/projects/%s/%s/" % (project.organization.slug, "foobar")
85-
if django.VERSION < (1, 9):
86-
# Django 1.9 no longer forcefully rewrites relative redirects to absolute URIs because of RFC 7231.
87-
redirect_path = "http://testserver" + redirect_path
8884
# XXX: AttributeError: 'Response' object has no attribute 'url'
8985
# (this is with self.assertRedirects(response, ...))
9086
assert response["Location"] == redirect_path

0 commit comments

Comments
 (0)