--- a/Allura/allura/tests/functional/test_discuss.py
+++ b/Allura/allura/tests/functional/test_discuss.py
@@ -107,6 +107,8 @@
             if 'attachment' in alink['href']:
                 alink = str(alink['href'])
                 break
+        else:
+            assert False, 'attachment link not found'
         r = self.app.get(alink)
         assert 'Content-Disposition' not in r.headers
         r = self.app.post(self.post_link + 'attach',