#NEWLINE# def test_date_due_not_set_small_invoice( self ) : #NEWLINE# #INDENT# "Date Due doesn't get set if the invoice is small" #NEWLINE# Subscription . objects . all ( ) . delete ( ) #NEWLINE# plan = DefaultProductPlan . objects . get ( edition = SoftwarePlanEdition . STANDARD , product_type = SoftwareProductType . COMMCARE , is_trial = False ) . plan . get_version ( ) #NEWLINE# subscription_length = 5 #NEWLINE# subscription_start_date = datetime . date ( 2016 , 2 , 23 ) #NEWLINE# subscription_end_date = add_months_to_date ( subscription_start_date , subscription_length ) #NEWLINE# subscription = generator . generate_domain_subscription ( self . account , self . domain , date_start = subscription_start_date , date_end = subscription_end_date , plan_version = plan ) #NEWLINE# invoice_date_small = utils . months_from_date ( subscription . date_start , 1 ) #NEWLINE# tasks . generate_invoices ( invoice_date_small ) #NEWLINE# small_invoice = subscription . invoice_set . first ( ) #NEWLINE# self . assertTrue ( ( small_invoice . balance <= SMALL_INVOICE_THRESHOLD ) ) #NEWLINE# self . assertIsNone ( small_invoice . date_due )