MCPcopy
hub / github.com/django/django / test_symlink

Method test_symlink

tests/i18n/test_extraction.py:796–812  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

794 self.symlinked_dir = os.path.join(self.test_dir, "templates_symlinked")
795
796 def test_symlink(self):
797 if symlinks_supported():
798 os.symlink(os.path.join(self.test_dir, "templates"), self.symlinked_dir)
799 else:
800 self.skipTest(
801 "os.symlink() not available on this OS + Python version combination."
802 )
803 management.call_command(
804 "makemessages", locale=[LOCALE], verbosity=0, symlinks=True
805 )
806 self.assertTrue(os.path.exists(self.PO_FILE))
807 with open(self.PO_FILE) as fp:
808 po_contents = fp.read()
809 self.assertMsgId("This literal should be included.", po_contents)
810 self.assertLocationCommentPresent(
811 self.PO_FILE, None, "templates_symlinked", "test.html"
812 )
813
814
815class CopyPluralFormsExtractorTests(ExtractorTests):

Callers

nothing calls this directly

Calls 6

symlinks_supportedFunction · 0.90
assertMsgIdMethod · 0.80
joinMethod · 0.45
existsMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected