Commits

Éric Araujo  committed fdaa5ca

* Other minor edits

  • Participants
  • Parent commits 47443c8

Comments (0)

Files changed (2)

File pyramid_mixpanel/__init__.py

         try:
             params = {'event': event, 'properties': properties}
             data = base64.b64encode(json.dumps(params))
-            requests.get(url, params={'data': data})
+            # TODO POST is also accepted and better HTTP, use it
+            response = requests.get(url, params={'data': data})
         except Exception:
             log.exception('mixpanel track event exception: event %s; properties: %s',
                           event, properties)

File pyramid_mixpanel/tests/unittests/test_pyramid_mixpanel.py

 
     @mock.patch('pyramid_mixpanel.MixpanelUtility')
     def test_includeme(self, utility):
-        from pyramid_mixpanel import includeme, get_mixpanel_utility
+        from pyramid_mixpanel import includeme
         config = mock.Mock()
 
         includeme(config)
 
     @mock.patch('requests.get')
     @mock.patch('pyramid_mixpanel.log')
-    def test_track_exception(self, m_log, m_requests_get):
+    def test_track_exception(self, m_log, m_get):
         from pyramid_mixpanel import MixpanelUtility
         mu = MixpanelUtility({'pyramid_mixpanel.token': 'token'})
 
         mu.track('test_event', {'prop': Decimal(10)})
 
-        self.assertFalse(m_requests_get.called)
+        self.assertFalse(m_get.called)
         self.assertTrue(m_log.exception.called)