diff --git a/app.py b/app.py index 1238e4d..3354649 100755 --- a/app.py +++ b/app.py @@ -12,7 +12,7 @@ sys.path.insert(0, str(BASE_DIR / 'sampleproject')) # Set Django settings module -12os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'sampleproject.settings') +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'sampleproject.settings') # Import Django utilities import django diff --git a/tests/test_app_syntax.py b/tests/test_app_syntax.py new file mode 100644 index 0000000..3c91852 --- /dev/null +++ b/tests/test_app_syntax.py @@ -0,0 +1,13 @@ +import py_compile +import unittest +from pathlib import Path + + +class AppSyntaxTest(unittest.TestCase): + def test_app_compiles(self): + app_path = Path(__file__).resolve().parents[1] / "app.py" + py_compile.compile(str(app_path), doraise=True) + + +if __name__ == "__main__": + unittest.main()