def test_get_notification_invalid_code(self):
     handler = PagSeguroNotificationHandler(**self.data)
     with self.assertRaises(NotificationNotFoundException):
         response = handler.get_notification_response()
 def test_get_checkout_without_code(self):
     handler = PagSeguroNotificationHandler(**self.data)
     with self.assertRaises(ApiErrorException):
         response = handler.get_notification_response()
 def test_get_notification_response(self):
     handler = PagSeguroNotificationHandler(**self.data)
     response = handler.get_notification_response()
     self.assertEqual(response.status, u'Paga')
 def test_create_without_code(self):
     self.data['code'] = None
     with self.assertRaises(ValueError):
         handler = PagSeguroNotificationHandler(**self.data)
 def test_get_checkout_without_code(self):
     handler = PagSeguroNotificationHandler(**self.data)
     with self.assertRaises(ApiErrorException):
         response = handler.get_notification_response()
 def test_get_notification_invalid_code(self):
     handler = PagSeguroNotificationHandler(**self.data)
     with self.assertRaises(NotificationNotFoundException):
         response = handler.get_notification_response()
 def test_get_notification_response(self):
     handler = PagSeguroNotificationHandler(**self.data)
     response = handler.get_notification_response()
     self.assertEqual(response.status, u'Paga')