Skip to content

Commit

Permalink
Refactor for buyers home
Browse files Browse the repository at this point in the history
  • Loading branch information
sarias-eb committed Jun 11, 2020
1 parent 771fd00 commit 42c9774
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 13 deletions.
4 changes: 2 additions & 2 deletions supplier_app/new_urls/AP_urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@


company_pattern = [
url(r'^$', CompanyListView.as_view(), name='company-list'),
url(r'^deprecated$', CompanyListView.as_view(), name='company-list-deprecated'),
url(r'^create$', CompanyCreatorView.as_view(), name='company-create'),
url(r'^invite$', company_invite, name='company-invite'),
url(r'^taxpayerList$', BuyerTaxpayersList.as_view(), name='buyer-taxpayer-list'),
url(r'^$', BuyerTaxpayersList.as_view(), name='company-list'),
]

taxpayer_pattern = [
Expand Down
10 changes: 5 additions & 5 deletions supplier_app/tests/test_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -1819,15 +1819,15 @@ def setUp(self):
self.client.force_login(self.user)

def test_company_list(self):
response = self.client.get(reverse('company-list'))
response = self.client.get(reverse('company-list-deprecated'))
company1 = response.context[0]['company_list'][0]
self.assertIn(company1, self.company_list)
self.assertTrue(
len(response.context[0]['company_list']) >= 3
)

def test_company_list_template(self):
response = self.client.get(reverse('company-list'))
response = self.client.get(reverse('company-list-deprecated'))
self.assertTemplateUsed(response, 'supplier_app/AP/company_list.html')

def test_company_search(self):
Expand All @@ -1842,7 +1842,7 @@ def test_company_search(self):
CompanyFactory(name='tes name'),
]
response = self.client.get(
reverse('company-list'),
reverse('company-list-deprecated'),
{'company': 'test'},
)
for company in company_list:
Expand Down Expand Up @@ -2955,7 +2955,7 @@ def setUp(self):
self.client.force_login(self.user_buyer_with_google_social)

def test_taxpayer_eb_list(self):
response = self.client.get(reverse('buyer-taxpayer-list'))
response = self.client.get(reverse('company-list'))
company1 = response.context[0]['company_list'][0]
self.assertIn(company1, self.company_list)
self.assertTrue(
Expand All @@ -2966,5 +2966,5 @@ def test_taxpayer_eb_list(self):
)

def test_taxpayer_eb_list_template(self):
response = self.client.get(reverse('buyer-taxpayer-list'))
response = self.client.get(reverse('company-list'))
self.assertTemplateUsed(response, 'supplier_app/Buyer/taxpayer_list.html')
6 changes: 0 additions & 6 deletions templates/navbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,6 @@
{% endif %}
</div>
</li>
<li class="nav-item dropdown">
<a class="nav-link" href="{% url 'buyer-taxpayer-list' %}" role="button"
aria-haspopup="true" aria-expanded="false">
{% trans "Taxpayers" %}
</a>
</li>
{% endif %}
</ul>
</div>
Expand Down

0 comments on commit 42c9774

Please sign in to comment.