-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
EDA-1159: As a buyer, I want to be able to see the list of approved O…
…rganizations
- Loading branch information
Showing
9 changed files
with
306 additions
and
887 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2910,4 +2910,61 @@ def test_change_taxpayer_status_raise_exception(self): | |
|
||
def test_show_message_raise_exception(self): | ||
with self.assertRaises(NotImplementedError): | ||
self.main.show_message() | ||
self.main.show_message() | ||
|
||
|
||
class TestBuyerTaxpayersList(TestCase): | ||
def setUp(self): | ||
self.company1 = CompanyFactory( | ||
name='Empresa 1', | ||
description='Descripcion de la empresa 1' | ||
) | ||
self.company2 = CompanyFactory( | ||
name='Empresa 2', | ||
description='Descripcion de la empresa 2' | ||
) | ||
self.taxpayer_ar1 = TaxPayerArgentinaFactory( | ||
business_name=BUSINESS_EXAMPLE_NAME_1, | ||
workday_id='1', | ||
taxpayer_state=STATUS_PENDING, | ||
cuit='20317899653', | ||
company=self.company1, | ||
) | ||
self.taxpayer_ar2 = TaxPayerArgentinaFactory( | ||
business_name=BUSINESS_EXAMPLE_NAME_2, | ||
workday_id='2', | ||
taxpayer_state=STATUS_CHANGE_REQUIRED, | ||
cuit='20392379685', | ||
company=self.company2, | ||
) | ||
self.taxpayerebentity_1 = TaxPayerEBEntityFactory( | ||
taxpayer=self.taxpayer_ar1, | ||
) | ||
self.taxpayerebentity_2 = TaxPayerEBEntityFactory( | ||
taxpayer=self.taxpayer_ar2, | ||
) | ||
self.company_list = [ | ||
CompanyFactory(), | ||
CompanyFactory(), | ||
CompanyFactory(), | ||
] | ||
self.user_buyer_with_google_social = UserFactory(email='[email protected]') | ||
self.buyer_group = Group.objects.get(name='buyer') | ||
self.user_buyer_with_google_social.groups.add(self.buyer_group) | ||
self.client = Client() | ||
self.client.force_login(self.user_buyer_with_google_social) | ||
|
||
def test_taxpayer_eb_list(self): | ||
response = self.client.get(reverse('buyer-taxpayer-list')) | ||
company1 = response.context[0]['company_list'][0] | ||
self.assertIn(company1, self.company_list) | ||
self.assertTrue( | ||
len(response.context[0]['taxpayerebentity_list']) == 2 | ||
) | ||
self.assertTrue( | ||
len(response.context[0]['company_list']) == 3 | ||
) | ||
|
||
def test_taxpayer_eb_list_template(self): | ||
response = self.client.get(reverse('buyer-taxpayer-list')) | ||
self.assertTemplateUsed(response, 'supplier_app/Buyer/taxpayer_list.html') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Oops, something went wrong.