Browse Source

Added 'view on site' link to catalogue list page

master
David Winterbottom 13 years ago
parent
commit
6d6d8b8fda

+ 1
- 0
oscar/templates/dashboard/catalogue/product_list.html View File

@@ -82,6 +82,7 @@ Catalogue management | {{ block.super }}
82 82
 		{% endwith %}
83 83
 		<td>
84 84
 			<a class="btn btn-info" href="{% url dashboard:catalogue-product product.id %}">Edit</a>
85
+			<a class="btn btn-success" href="{{ product.get_absolute_id }}">View on site</a>
85 86
 		</td>
86 87
     </tr>
87 88
     {% endfor %}

+ 3
- 3
tests/functional/dashboard/catalogue_tests.py View File

@@ -7,10 +7,10 @@ from oscar.apps.dashboard.catalogue.forms import CategoryForm
7 7
 from oscar.apps.catalogue.categories import create_from_breadcrumbs
8 8
 
9 9
 
10
-class ViewTests(ClientTestCase):
10
+class TestCatalogueViews(ClientTestCase):
11 11
     is_staff = True
12 12
 
13
-    def test_pages_exist(self):
13
+    def test_exist(self):
14 14
         urls = [reverse('dashboard:catalogue-product-list'),
15 15
                 reverse('dashboard:catalogue-category-list'),
16 16
                 reverse('dashboard:stock-alert-list'),
@@ -30,7 +30,7 @@ def create_test_category_tree():
30 30
     create_from_breadcrumbs(trail)
31 31
 
32 32
 
33
-class CategoryFormTests(TestCase):
33
+class TestCategoryForm(TestCase):
34 34
 
35 35
     def setUp(self):
36 36
         Category.objects.all().delete()

+ 7
- 7
tests/functional/dashboard_tests.py View File

@@ -7,18 +7,18 @@ from oscar.test import ClientTestCase
7 7
 from oscar.test.helpers import create_order
8 8
 
9 9
 
10
-class AnonymousUserTests(ClientTestCase):
10
+class TestDashboardIndexForAnonUser(ClientTestCase):
11 11
     is_anonymous = True
12 12
 
13
-    def test_login_form_is_displayed_for_anon_user(self):
13
+    def test_is_not_available(self):
14 14
         response = self.client.get(reverse('dashboard:index'), follow=True)
15 15
         self.assertContains(response, 'login-username', status_code=200)
16 16
 
17 17
 
18
-class DashboardViewTests(ClientTestCase):
18
+class TestDashboardIndexForStaffUser(ClientTestCase):
19 19
     is_staff = True
20 20
 
21
-    def test_dashboard_index_is_for_staff_only(self):
21
+    def test_is_available(self):
22 22
         urls = ('dashboard:index',
23 23
                 'dashboard:order-list',
24 24
                 'dashboard:users-index',)
@@ -26,7 +26,7 @@ class DashboardViewTests(ClientTestCase):
26 26
             response = self.client.get(reverse(name))
27 27
             self.assertTrue('Password' not in response.content)
28 28
 
29
-    def test_dashboard_hourly_report_with_no_orders(self):
29
+    def test_includes_hourly_report_with_no_orders(self):
30 30
         report = IndexView().get_hourly_report()
31 31
         self.assertItemsEqual(report, ['order_total_hourly', 'max_revenue',
32 32
                                        'y_range'])
@@ -34,7 +34,7 @@ class DashboardViewTests(ClientTestCase):
34 34
         self.assertEquals(len(report['y_range']), 0)
35 35
         self.assertEquals(report['max_revenue'], 0)
36 36
 
37
-    def test_dashboard_hourly_report_with_orders(self):
37
+    def test_includes_hourly_report_with_orders(self):
38 38
         create_order(total_incl_tax=D('34.05'), total_excl_tax=D('34.05'))
39 39
         create_order(total_incl_tax=D('21.90'), total_excl_tax=D('21.90'))
40 40
         report = IndexView().get_hourly_report()
@@ -43,7 +43,7 @@ class DashboardViewTests(ClientTestCase):
43 43
         self.assertEquals(len(report['y_range']), 11)
44 44
         self.assertEquals(report['max_revenue'], D('60'))
45 45
 
46
-    def test_dashboard_index_has_stats_vars_in_context(self):
46
+    def test_has_stats_vars_in_context(self):
47 47
         response = self.client.get(reverse('dashboard:index'))
48 48
 
49 49
         self.assertInContext(response, 'total_orders_last_day')

Loading…
Cancel
Save