--- /dev/null
+from django.test import TestCase
+
+import pyflakes.api
+import os
+
+class PyflakesTest(TestCase):
+ def setUp(self):
+ topdir = os.path.dirname(os.path.realpath(__file__))
+ self.pythonfiles = []
+
+ for folder, subfolders, files in os.walk(topdir):
+ if 'migrations' in subfolders:
+ subfolders.remove('migrations')
+
+ for file in files:
+ if not file.endswith('.py'):
+ continue
+ self.pythonfiles += [os.path.join(folder, file)]
+
+ def test_pyflakes(self):
+ for file in self.pythonfiles:
+ self.assertEqual(pyflakes.api.checkPath(file), 0)