Skip to content

Commit

Permalink
Merge pull request #98 from ZuluPro/fix_83
Browse files Browse the repository at this point in the history
Change Google Chart URL (Fix #83)
  • Loading branch information
kylef committed Apr 12, 2016
2 parents 1b52060 + d8a40c4 commit 0ed59c5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion request/templatetags/request_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def trunc(string, chars):

#@register.simple_tag
def pie_chart(items, width=440, height=190):
return 'http://chart.apis.google.com/chart?cht=p3&chd=t:%s&chs=%sx%s&chl=%s' % (
return '//chart.googleapis.com/chart?cht=p3&chd=t:%s&chs=%sx%s&chl=%s' % (
','.join([str(item[1]) for item in items]),
width,
height,
Expand Down
4 changes: 2 additions & 2 deletions tests/test_templatestags.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ class RequestAdminPieChart(TestCase):
def test_pie_chart(self):
inventory = ['apple', 'lemon', 'apple', 'orange', 'lemon', 'lemon']
result = pie_chart(inventory)
self.assertTrue(result.startswith('http://chart.apis.google.com/chart?'))
self.assertTrue(result.startswith('//chart.googleapis.com/chart?'))
self.assertIn('chs=440x190', result)

result = pie_chart(inventory, width=100, height=100)
self.assertTrue(result.startswith('http://chart.apis.google.com/chart?'))
self.assertTrue(result.startswith('//chart.googleapis.com/chart?'))
self.assertIn('chs=100x100', result)


Expand Down

0 comments on commit 0ed59c5

Please sign in to comment.