<s> from datetime import date <EOL> from . base import TestBase <EOL> from . . models import InvoiceRequest , Event , Host <EOL> from . . forms import InvoiceRequestForm <EOL> class TestInvoiceRequestForm ( TestBase ) : <EOL> def setUp ( self ) : <EOL> self . _setUpUsersAndLogin ( ) <EOL> def test_adding_minimal ( self ) : <EOL> """<STR_LIT>""" <EOL> event = Event . objects . create ( <EOL> slug = '<STR_LIT>' , host = Host . objects . first ( ) , <EOL> start = '<STR_LIT>' , admin_fee = <NUM_LIT> , <EOL> venue = '<STR_LIT>' , <EOL> ) <EOL> data = { <EOL> '<STR_LIT>' : event . host . pk , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT:date>' : event . start , <EOL> '<STR_LIT>' : event . pk , <EOL> '<STR_LIT>' : event . venue , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : event . admin_fee , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> } <EOL> form = InvoiceRequestForm ( data ) <EOL> self . assertTrue ( form . is_valid ( ) ) <EOL> self . assertEqual ( event . invoicerequest_set . count ( ) , <NUM_LIT:0> ) <EOL> form . save ( ) <EOL> self . assertEqual ( event . invoicerequest_set . count ( ) , <NUM_LIT:1> ) <EOL> class TestInvoiceRequest ( TestBase ) : <EOL> def setUp ( self ) : <EOL> self . _setUpUsersAndLogin ( ) <EOL> def test_status_repr ( self ) : <EOL> """<STR_LIT>""" <EOL> day = date ( <NUM_LIT> , <NUM_LIT:2> , <NUM_LIT:9> ) <EOL> event = Event . objects . create ( <EOL> slug = '<STR_LIT>' , host = Host . objects . first ( ) , <EOL> start = day , admin_fee = <NUM_LIT> , <EOL> venue = '<STR_LIT>' , <EOL> ) <EOL> request = InvoiceRequest . objects . create ( <EOL> organization = event . host , date = event . start , <EOL> event = event , event_location = event . venue , <EOL> contact_name = '<STR_LIT>' , contact_email = '<STR_LIT>' , <EOL> full_address = '<STR_LIT>' , <EOL> amount = event . admin_fee , form_W9 = False , <EOL> sent_date = day , paid_date = day , <EOL> ) <EOL> tests = [ <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ] <EOL> for status , long_status in tests : <EOL> with self . subTest ( status = status ) : <EOL> request . status = status <EOL> self . assertEqual ( request . long_status , long_status ) </s>
