Esempio n. 1
0
 def test_spelling(self):
     status = StringIO()
     with TemporaryDirectory() as OUT_DIR:
         with tmp_list_append(sys.argv, 'spelling'):
             try:
                 app = Sphinx(
                     srcdir=DOCS_DIR,
                     confdir=DOCS_DIR,
                     outdir=OUT_DIR,
                     doctreedir=OUT_DIR,
                     buildername="spelling",
                     warningiserror=True,
                     status=status,
                     confoverrides={
                         'extensions': [
                             'djangocms',
                             'sphinx.ext.intersphinx',
                             'sphinxcontrib.spelling'
                         ]
                     }
                 )
                 app.build()
                 self.assertEqual(app.statuscode, 0, status.getvalue())
             except SphinxWarning:
                 # while normally harmless, causes a test failure
                 pass
             except:
                 print(status.getvalue())
                 raise
Esempio n. 2
0
 def test_collectstatic_with_cached_static_files_storage(self):
     # CachedStaticFilesStorage requires that the CSS files
     # don't contain any broken links.
     with TemporaryDirectory() as tmpdir:
         with SettingsOverride(STATIC_ROOT=tmpdir,
             STATICFILES_STORAGE='django.contrib.staticfiles.storage.CachedStaticFilesStorage'):
             with StdoutOverride() as output:
                 management.call_command('collectstatic', interactive=False)
Esempio n. 3
0
 def test_po_sanity(self):
     with TemporaryDirectory() as tmpdir:
         shutil.copytree(SOURCE_DIR, os.path.join(tmpdir, 'locale'))
         olddir = os.getcwd()
         os.chdir(tmpdir)
         ok, stderr = compile_messages()
         os.chdir(olddir)
     self.assertTrue(ok, stderr)
Esempio n. 4
0
 def test_html(self):
     status = StringIO()
     with TemporaryDirectory() as OUT_DIR:
         app = Sphinx(
             srcdir=DOCS_DIR,
             confdir=DOCS_DIR,
             outdir=OUT_DIR,
             doctreedir=OUT_DIR,
             buildername="html",
             warningiserror=True,
             status=status,
         )
         try:
             app.build()
         except:
             print(status.getvalue())
             raise
Esempio n. 5
0
 def test_html(self):
     nullout = StringIO()
     with TemporaryDirectory() as OUT_DIR:
         app = Sphinx(
             DOCS_DIR,
             DOCS_DIR,
             OUT_DIR,
             OUT_DIR,
             "html",
             warningiserror=True,
             status=nullout,
         )
         try:
             app.build()
         except:
             print(nullout.getvalue())
             raise