Skip to content

Commit

Permalink
Merge pull request #236 from MithishR/ojus-fix-header-link
Browse files Browse the repository at this point in the history
Removed View Cart from Header
  • Loading branch information
MithishR authored Apr 12, 2024
2 parents a7d6ec7 + 08d3be4 commit b32bbd7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
2 changes: 0 additions & 2 deletions Django/communicado/pages/templates/pages/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@
<a id="user-account-link" href="{% url 'useracc' %}">{{ request.session.userName}}'s Account</a>
{% endif %}

<a id="view-cart-link" href="#">View Cart</a>

{% if request.session.userRole == 'Admin' %}
<a id="admin-panel-link" href="admin">Admin Panel</a>
{% endif %}
Expand Down
9 changes: 3 additions & 6 deletions Django/communicado/pages/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,6 @@ def test_xyz_page_loads_correctly(self):

# Check if the response contains the expected content
self.assertContains(response, "Welcome to Communicado")
self.assertContains(response, "View Cart")
self.assertContains(response, "Admin Panel")

def test_xyz_page_contains_header_links(self):
Expand Down Expand Up @@ -686,7 +685,6 @@ def test_header_ui_not_logged_in(self):
self.assertContains(response, '<img id="logo-img" src="/static/logo.jpg" alt="Logo">')
self.assertContains(response, '<nav id="main-nav">')
self.assertContains(response, '<a id="login-link" href="/login/">Login</a>')
self.assertContains(response, '<a id="view-cart-link" href="#">View Cart</a>')

self.assertNotContains(response, '<a id="logout-link" href="/logout/">Log Out</a>')
self.assertNotContains(response, '<a id="user-account-link" href="/useracc">\'s Account</a>')
Expand All @@ -703,7 +701,6 @@ def test_header_ui_logged_in_user(self):
self.assertContains(response, '<header id="main-header">')
self.assertContains(response, '<img id="logo-img" src="/static/logo.jpg" alt="Logo">')
self.assertContains(response, '<nav id="main-nav">')
self.assertContains(response, '<a id="view-cart-link" href="#">View Cart</a>')
self.assertContains(response, '<a id="user-account-link" href="/useracc">\'s Account</a>')

self.assertNotContains(response, '<a id="login-link" href="/login/">Login</a>')
Expand All @@ -721,7 +718,6 @@ def test_header_ui_logged_in_admin(self):
self.assertContains(response, '<header id="main-header">')
self.assertContains(response, '<img id="logo-img" src="/static/logo.jpg" alt="Logo">')
self.assertContains(response, '<nav id="main-nav">')
self.assertContains(response, '<a id="view-cart-link" href="#">View Cart</a>')
self.assertContains(response, '<a id="user-account-link" href="/useracc">\'s Account</a>')
self.assertContains(response, '<a id="admin-panel-link" href="admin">Admin Panel</a>')

Expand Down Expand Up @@ -886,6 +882,7 @@ def test_deleted_events(self):
with self.assertRaises(Events.DoesNotExist):
Events.objects.get(eventID=self.event.eventID)


def test_logout_functionality(self):
username = 'ojus1'
password = 'ojus123'
Expand All @@ -895,10 +892,10 @@ def test_logout_functionality(self):

response = self.client.get(reverse('logout'))

self.assertContains(response, '<a id="view-cart-link" href="#">View Cart</a>')
self.assertNotContains(response, '<a id="user-account-link" href="/useracc">\'s Account</a>')
self.assertNotContains(response, '<a id="admin-panel-link" href="admin">Admin Panel</a>')
self.assertContains(response, '<a id="login-link" href="/login/">Login</a>')


def test_logout_ui(self):
response = self.client.get(reverse('logout'))
Expand All @@ -907,11 +904,11 @@ def test_logout_ui(self):
self.assertContains(response, '<h1>Logout Confirmation</h1>')
self.assertContains(response, '<p>You have been successfully logged out.</p>')
self.assertContains(response, '<img src="/static/logout.gif" alt="Logout Image">')
self.assertContains(response, '<a id="view-cart-link" href="#">View Cart</a>')
self.assertNotContains(response, '<a id="user-account-link" href="/useracc">\'s Account</a>')
self.assertNotContains(response, '<a id="admin-panel-link" href="admin">Admin Panel</a>')

self.assertContains(response, '<a id="login-link" href="/login/">Login</a>')

def test_edituseracc(self):
user = users.objects.create(
role="customer",
Expand Down

0 comments on commit b32bbd7

Please sign in to comment.