<s> from mock import patch <EOL> from hc . payments . models import Subscription <EOL> from hc . test import BaseTestCase <EOL> class CancelPlanTestCase ( BaseTestCase ) : <EOL> def setUp ( self ) : <EOL> super ( CancelPlanTestCase , self ) . setUp ( ) <EOL> self . sub = Subscription ( user = self . alice ) <EOL> self . sub . subscription_id = "<STR_LIT>" <EOL> self . sub . plan_id = "<STR_LIT>" <EOL> self . sub . save ( ) <EOL> @ patch ( "<STR_LIT>" ) <EOL> def test_it_works ( self , mock_braintree ) : <EOL> self . client . login ( username = "<STR_LIT>" , password = "<STR_LIT:password>" ) <EOL> r = self . client . post ( "<STR_LIT>" ) <EOL> self . assertRedirects ( r , "<STR_LIT>" ) <EOL> self . sub . refresh_from_db ( ) <EOL> self . assertEqual ( self . sub . subscription_id , "<STR_LIT>" ) <EOL> self . assertEqual ( self . sub . plan_id , "<STR_LIT>" ) </s>
