Skip to content

Commit

Permalink
Revert "Fixes bug 1174169 - Fixed magic beta filter for report/list/."
Browse files Browse the repository at this point in the history
This reverts commit 498f453.
  • Loading branch information
rhelmer committed Jun 18, 2015
1 parent 5a27268 commit 7d183d5
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 17 deletions.
3 changes: 3 additions & 0 deletions socorro/external/postgresql/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,9 @@ def build_version_where(
if channel.startswith(tuple(config.non_release_channels)):
# This is a non-release channel.

# Use major_version instead of full version.
sql_params[version_param] = version_data["major_version"]

# Restrict by release_channel.
version_where.append("r.release_channel ILIKE '%s'" % channel)

Expand Down
34 changes: 17 additions & 17 deletions socorro/unittest/external/postgresql/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ def test_build_reports_sql_where(self):
sql_params = {}
params.report_type = default_params.report_type
params.versions = ["Firefox", "12.0a1", "Fennec", "11.0", "Firefox",
"13.0b"]
"13.0(beta)"]
params.versions_info = {
"Firefox:12.0a1": {
"version_string": "12.0a1",
Expand All @@ -308,7 +308,7 @@ def test_build_reports_sql_where(self):
"build_id": ["20120101123456"],
"is_rapid_beta": False,
"from_rapid_beta": False,
"from_beta_version": "Firefox:12.0a1",
"rapid_beta_version": "Firefox:12.0a1",
},
"Fennec:11.0": {
"version_string": "11.0",
Expand All @@ -318,17 +318,17 @@ def test_build_reports_sql_where(self):
"build_id": None,
"is_rapid_beta": False,
"from_rapid_beta": False,
"from_beta_version": "Fennec:11.0",
"rapid_beta_version": "Fennec:11.0",
},
"Firefox:13.0b1": {
"version_string": "13.0b1",
"Firefox:13.0(beta)": {
"version_string": "13.0(beta)",
"product_name": "Firefox",
"major_version": "13.0",
"release_channel": "Beta",
"build_id": ["20120101123456", "20120101098765"],
"is_rapid_beta": False,
"from_rapid_beta": True,
"from_beta_version": "Firefox:13.0b",
"rapid_beta_version": "Firefox:13.0b",
},
"Firefox:13.0b": {
"version_string": "13.0b",
Expand All @@ -338,7 +338,7 @@ def test_build_reports_sql_where(self):
"build_id": None,
"is_rapid_beta": True,
"from_rapid_beta": True,
"from_beta_version": "Firefox:13.0b",
"rapid_beta_version": "Firefox:13.0b",
}
}

Expand All @@ -365,17 +365,17 @@ def test_build_reports_sql_where(self):
"from_date": params.from_date,
"to_date": params.to_date,
"version0": "Firefox",
"version1": "12.0a1",
"version1": "12.0",
"version2": "Firefox",
"version3": "12.0a1",
"version4": "Fennec",
"version5": "11.0",
"version6": "Fennec",
"version7": "11.0",
"version8": "Firefox",
"version9": "13.0b1",
"version9": "13.0",
"version10": "Firefox",
"version11": "13.0b",
"version11": "13.0(beta)",
}

(sql, sql_params) = pgbase.build_reports_sql_where(params, sql_params,
Expand Down Expand Up @@ -478,8 +478,8 @@ def test_build_version_where(self):
"release_channel": None,
"build_id": None
},
"Firefox:13.0b": {
"version_string": "13.0b",
"Firefox:13.0(beta)": {
"version_string": "13.0(beta)",
"product_name": "Firefox",
"major_version": "13.0",
"release_channel": "beta",
Expand All @@ -502,16 +502,16 @@ def test_build_version_where(self):
}

# test 1
params["versions"] = ["Firefox", "13.0b"]
key = "Firefox:13.0b"
params["versions"] = ["Firefox", "13.0(beta)"]
key = "Firefox:13.0(beta)"
x = 0
sql_params = {
"version0": "Firefox",
"version1": "13.0b"
"version1": "13.0(beta)"
}
sql_params_exp = {
"version0": "Firefox",
"version1": "13.0b"
"version1": "13.0"
}
version_where = []
version_where_exp = (
Expand All @@ -525,7 +525,7 @@ def test_build_version_where(self):

version_where = pgbase.build_version_where(
"Firefox",
"13.0b",
"13.0",
x,
sql_params,
params["versions_info"][key],
Expand Down

0 comments on commit 7d183d5

Please sign in to comment.