def test_escapes_js_for_label(self): output = analytics_tags.track_event("Category", "action", "company's bad;-stuff.") expected = "onClick=\"_gaq.push(['_trackEvent', 'Category', 'action', 'company\\u0027s bad\\u003B-stuff.']);\"" self.assertEqual(expected, output)
def test_leaves_label_hyphens(self): output = analytics_tags.track_event("Category", "action", "company-id") expected = "onClick=\"_gaq.push(['_trackEvent', 'Category', 'action', 'company-id']);\"" self.assertEqual(expected, output)