Beispiel #1
0
 def test_expand_db_attributes_for_editor_with_missing_id(self):
     result = EditorHtmlDocumentLinkHandler.expand_db_attributes({})
     self.assertEqual(result, '<a data-linktype="document">')
Beispiel #2
0
 def test_expand_db_attributes_for_editor_preserves_id_of_nonexistent_document(
         self):
     result = EditorHtmlDocumentLinkHandler.expand_db_attributes({'id': 0})
     self.assertEqual(result, '<a data-linktype="document" data-id="0">')
Beispiel #3
0
 def test_expand_db_attributes_for_editor(self):
     result = EditorHtmlDocumentLinkHandler.expand_db_attributes({'id': 1})
     self.assertEqual(
         result,
         '<a data-linktype="document" data-id="1" href="/documents/1/test.pdf">'
     )
Beispiel #4
0
 def test_expand_db_attributes_for_editor_with_missing_id(self):
     result = EditorHtmlDocumentLinkHandler.expand_db_attributes({})
     self.assertEqual(
         result,
         '<a data-linktype="document">'
     )
Beispiel #5
0
 def test_expand_db_attributes_for_editor_preserves_id_of_nonexistent_document(self):
     result = EditorHtmlDocumentLinkHandler.expand_db_attributes({'id': 0})
     self.assertEqual(
         result,
         '<a data-linktype="document" data-id="0">'
     )
Beispiel #6
0
 def test_expand_db_attributes_for_editor(self):
     result = EditorHtmlDocumentLinkHandler.expand_db_attributes({'id': 1})
     self.assertEqual(
         result,
         '<a data-linktype="document" data-id="1" href="/documents/1/test.pdf">'
     )