Commits

Olemis Lang committed d3ad5e3

BH Multiproduct #669 : Fix test case for product edit links for authenticated users

  • Participants
  • Parent commits 2b1f37c
  • Branches t669_product_edit

Comments (0)

Files changed (2)

File t669/t669_r1525378_product_edit.diff

 # HG changeset patch
-# Parent 5c4d7a1d1dab0a5d58e4bbbf53bc2b305b523f46
+# Parent c58a0213e3a52ec06b81272d0ec1d283781e9c54
 BH Theme #669 : Edit link for products
 
-diff -r 5c4d7a1d1dab bloodhound_multiproduct/multiproduct/hooks.py
---- a/bloodhound_multiproduct/multiproduct/hooks.py	Tue Sep 24 23:06:30 2013 -0500
-+++ b/bloodhound_multiproduct/multiproduct/hooks.py	Tue Sep 24 23:42:42 2013 -0500
+diff -r c58a0213e3a5 bloodhound_multiproduct/multiproduct/hooks.py
+--- a/bloodhound_multiproduct/multiproduct/hooks.py	Tue Sep 24 23:49:23 2013 -0500
++++ b/bloodhound_multiproduct/multiproduct/hooks.py	Wed Sep 25 00:01:38 2013 -0500
 @@ -37,13 +37,14 @@
      def open_environment(self, environ, env_path, global_env, use_cache=False):
          environ.setdefault('SCRIPT_NAME', '')  # bh:ticket:594
  
          return env
  
-diff -r 5c4d7a1d1dab bloodhound_theme/bhtheme/templates/bh_product_list.html
---- a/bloodhound_theme/bhtheme/templates/bh_product_list.html	Tue Sep 24 23:06:30 2013 -0500
-+++ b/bloodhound_theme/bhtheme/templates/bh_product_list.html	Tue Sep 24 23:42:42 2013 -0500
+diff -r c58a0213e3a5 bloodhound_theme/bhtheme/templates/bh_product_list.html
+--- a/bloodhound_theme/bhtheme/templates/bh_product_list.html	Tue Sep 24 23:49:23 2013 -0500
++++ b/bloodhound_theme/bhtheme/templates/bh_product_list.html	Wed Sep 25 00:01:38 2013 -0500
 @@ -37,7 +37,7 @@
          <xi:include href="widget_media_list.html" py:with="items = products"/>
  
              <input type="hidden" name="action" value="new" />
              <input class="btn" type="submit" value="${_('Add new product')}" />
            </form>
-diff -r 5c4d7a1d1dab bloodhound_theme/bhtheme/theme.py
---- a/bloodhound_theme/bhtheme/theme.py	Tue Sep 24 23:06:30 2013 -0500
-+++ b/bloodhound_theme/bhtheme/theme.py	Tue Sep 24 23:42:42 2013 -0500
-@@ -468,18 +468,25 @@
+diff -r c58a0213e3a5 bloodhound_theme/bhtheme/theme.py
+--- a/bloodhound_theme/bhtheme/theme.py	Tue Sep 24 23:49:23 2013 -0500
++++ b/bloodhound_theme/bhtheme/theme.py	Wed Sep 25 00:01:38 2013 -0500
+@@ -468,18 +468,26 @@
                          description=format_to_html(self.env,
                                                     product_ctx(product),
                                                     product.description),
 -                                           'label': 'Wiki'}],
 +                        links={'extras': (([{'href': req.href.products(
 +                                                product.prefix, action='edit'),
-+                                             'title': _('Edit product'),
++                                             'title': _('Edit product %(prefix)s',
++                                                        prefix=product.prefix),
 +                                             'icon': tag.i(class_='icon-edit'),
 +                                             'label': _('Edit')},]
 +                                           if 'PRODUCT_MODIFY' in req.perm

File t669/t669_r1525378_product_edit.tests.diff

 # HG changeset patch
-# Parent 1ee304b35ef2725806c4d82209f9a8bf5f07d897
+# Parent 02719d080608b2ec8c2bf72c97c37618bc464418
 BH Multiproduct #669 : Functional test cases for product list
 
-diff -r 1ee304b35ef2 bloodhound_multiproduct/tests/functional/product.py
---- a/bloodhound_multiproduct/tests/functional/product.py	Tue Sep 24 23:49:23 2013 -0500
-+++ b/bloodhound_multiproduct/tests/functional/product.py	Tue Sep 24 23:51:51 2013 -0500
+diff -r 02719d080608 bloodhound_multiproduct/tests/functional/product.py
+--- a/bloodhound_multiproduct/tests/functional/product.py	Wed Sep 25 00:01:38 2013 -0500
++++ b/bloodhound_multiproduct/tests/functional/product.py	Wed Sep 25 00:21:37 2013 -0500
 @@ -17,6 +17,8 @@
  #  specific language governing permissions and limitations
  #  under the License.
  from trac.tests import contentgen
  from trac.tests import functional
  from trac.tests.functional.tester import tc
-@@ -46,12 +48,35 @@
+@@ -46,12 +48,37 @@
          tc.find('<a[^>]*>Index by Title')
  
  
 +        """Edit product visible if granted with PRODUCT_MODIFY
 +        """
 +        prefix = self._tester.create_product()
-+        tc.follow('Edit product ' + prefix)
-+        tc.url(self._tester.url + '/products/' + prefix + '?action=edit')
++        tc.go(self._tester.url + '/products')
++        tc.follow('.*/products/' + prefix + r'\?action=edit')
++        tc.find('Edit Product')
++        tc.find(prefix)
 +
 +
  def functionalSuite(suite=None):