Commits

Chris Chambers  committed c3ab7dd

Updates fall through to excerpts if they don't match

Also updated the test to reflect what it is actually looking for
i.e. excerpts that look like updates, not malformed updates

  • Participants
  • Parent commits afedc09

Comments (0)

Files changed (2)

                     interspersed += match.group('list') or ''
                     interspersed += MANGO_PLACEHOLDER + '\n'
                     updates.append(update)
+                    continue;
                 else:
-                    interspersed += section
                     logger.warning(
-                      'Failed to correctly render update block - malformed or insufficient metadata: %s'
+                      'Section looking like an update failed to render, may be due to '
+                      'insufficient/incorrect metadata or an excerpt starting with '
+                      'the word "Update". Section=%s'
                       %section)
-                continue;
 
             if section:
                 interspersed += section

File tests/__init__.py

         
         * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
         
-        ### Update: 20 August 2011 @ 1:30pm
+        ### Update for compatibility for OS X 10.7
         
         I was confused as to the definition of idempotent. It would
         be more accurate to describe the transaction as reversible.
         
         More text.
         ''')
-    def test_insufficient_metadata(self, document):
+    def test_excerpts_starting_with_update(self, document):
         self.assertEqual(
         document.html,
         u'<p>Text.</p>\n'
-        u'<h3>Update: 20 August 2011 @ 1:30pm</h3>\n'
+        u'<h3>Update for compatibility for OS X 10.7</h3>\n'
         u'<p>I was confused as to the definition of idempotent. It would\n'
            u'be more accurate to describe the transaction as reversible.</p>\n'
         u'<p>More text.</p>'
         )
         self.assertEqual(
-        document.excerpt(), document.html
+        document.excerpt(),
+        u'<h3>Update for compatibility for OS X 10.7</h3>\n'
+        u'<p>I was confused as to the definition of idempotent. It would\n'
+        u'be more accurate to describe the transaction as reversible.</p>'
         )
 
     @md('''