#NEWLINE# def test_country_user( self ) : #NEWLINE# #INDENT# 'Country as well as region users should get notifications.' #NEWLINE# other_user = bootstrap_web_user ( username = 'test2' , domain = self . TEST_DOMAIN , phone_number = '+44445' , location = self . country , password = 'dummy' , email = 'test@example.com' , user_data = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# assign_products_to_location ( self . facility , [ self . product ] ) #NEWLINE# assign_products_to_location ( self . other_facility , [ self . product ] ) #NEWLINE# assign_products_to_location ( self . last_facility , [ self . product ] ) #NEWLINE# create_stock_report ( self . facility , { #NEWLINE# #INDENT# 'tp' : 0 , #NEWLINE# #UNINDENT# } ) #NEWLINE# create_stock_report ( self . other_facility , { #NEWLINE# #INDENT# 'tp' : 0 , #NEWLINE# #UNINDENT# } ) #NEWLINE# create_stock_report ( self . last_facility , { #NEWLINE# #INDENT# 'tp' : 0 , #NEWLINE# #UNINDENT# } ) #NEWLINE# generated = list ( UrgentStockoutAlert ( self . TEST_DOMAIN ) . get_notifications ( ) ) #NEWLINE# self . assertEqual ( len ( generated ) , 2 ) #NEWLINE# self . assertEqual ( { generated [ 0 ] . user . get_id , generated [ 1 ] . user . get_id } , { generated . user . get_id , other_user . get_id } )