#NEWLINE# def test_delivery_reminder_facility( self ) : #NEWLINE# #INDENT# date = datetime ( 2015 , 5 , 1 ) #NEWLINE# DeliveryReminder ( TEST_DOMAIN , date ) . send ( ) #NEWLINE# self . assertEqual ( SMS . objects . count ( ) , 1 ) #NEWLINE# statuses = SupplyPointStatus . objects . filter ( status_type = SupplyPointStatusTypes . DELIVERY_FACILITY ) #NEWLINE# self . assertEqual ( statuses . count ( ) , 1 ) #NEWLINE# smses = SMS . objects . all ( ) #NEWLINE# self . assertEqual ( smses . first ( ) . text , unicode ( DELIVERY_REMINDER_FACILITY ) ) #NEWLINE# self . assertEqual ( statuses . values_list ( 'location_id' , flat = True ) [ 0 ] , now . facility2 . get_id ) #NEWLINE# now = datetime . utcnow ( ) #NEWLINE# DeliveryReminder ( TEST_DOMAIN , date ) . send ( ) #NEWLINE# self . assertEqual ( SMS . objects . filter ( date__gte = now ) . count ( ) , 0 )