Example #1
0
 def test_expand_db_attributes_not_for_editor(self):
     result = DocumentLinkHandler.expand_db_attributes(
         {'id': 1},
         False
     )
     self.assertEqual(result,
                      '<a href="/documents/1/test.pdf">')
Example #2
0
 def test_expand_db_attributes_for_editor(self):
     result = DocumentLinkHandler.expand_db_attributes(
         {'id': 1},
         True
     )
     self.assertEqual(result,
                      '<a data-linktype="document" data-id="1" href="/documents/1/test.pdf">')
Example #3
0
 def test_expand_db_attributes_not_for_editor(self):
     result = DocumentLinkHandler.expand_db_attributes(
         {'id': 1},
         False
     )
     self.assertEqual(result,
                      '<a href="/documents/1/">')
Example #4
0
 def test_expand_db_attributes_for_editor(self):
     result = DocumentLinkHandler.expand_db_attributes(
         {'id': 1},
         True
     )
     self.assertEqual(result,
                      '<a data-linktype="document" data-id="1" href="/documents/1/">')
Example #5
0
 def test_expand_db_attributes_document_does_not_exist(self):
     result = DocumentLinkHandler.expand_db_attributes(
         {'id': 0},
         False
     )
     self.assertEqual(result, '<a>')
Example #6
0
 def test_expand_db_attributes_document_does_not_exist(self):
     result = DocumentLinkHandler.expand_db_attributes({'id': 0}, False)
     self.assertEqual(result, '<a>')