@ -591,6 +591,13 @@ class NotifyTestCase(BaseTestCase):
n = Notification . objects . get ( )
n = Notification . objects . get ( )
self . assertTrue ( " Monthly SMS limit exceeded " in n . error )
self . assertTrue ( " Monthly SMS limit exceeded " in n . error )
# And email should have been sent
self . assertEqual ( len ( mail . outbox ) , 1 )
email = mail . outbox [ 0 ]
self . assertEqual ( email . to [ 0 ] , " [email protected] " )
self . assertEqual ( email . subject , " Monthly SMS Limit Reached " )
@patch ( " hc.api.transports.requests.request " )
@patch ( " hc.api.transports.requests.request " )
def test_sms_limit_reset ( self , mock_post ) :
def test_sms_limit_reset ( self , mock_post ) :
# At limit, but also into a new month
# At limit, but also into a new month
@ -652,6 +659,13 @@ class NotifyTestCase(BaseTestCase):
n = Notification . objects . get ( )
n = Notification . objects . get ( )
self . assertTrue ( " Monthly message limit exceeded " in n . error )
self . assertTrue ( " Monthly message limit exceeded " in n . error )
# And email should have been sent
self . assertEqual ( len ( mail . outbox ) , 1 )
email = mail . outbox [ 0 ]
self . assertEqual ( email . to [ 0 ] , " [email protected] " )
self . assertEqual ( email . subject , " Monthly WhatsApp Limit Reached " )
@patch ( " apprise.Apprise " )
@patch ( " apprise.Apprise " )
@override_settings ( APPRISE_ENABLED = True )
@override_settings ( APPRISE_ENABLED = True )
def test_apprise_enabled ( self , mock_apprise ) :
def test_apprise_enabled ( self , mock_apprise ) :