def test_inside_virtualenv(self, stderr): with _patch_inside_virtual_env(True): with self.assertRaises(SystemExit) as raised: cli.main() self.assertEqual(raised.exception.code, 2) self.assertEqual(stderr.getvalue().splitlines(), ['django-develop not configured, try "django-develop-config"'])
def test_outside_virtualenv(self, stderr): with _patch_inside_virtual_env(False): with self.assertRaises(SystemExit) as raised: cli.main() self.assertEqual(raised.exception.code, 2) self.assertEqual(stderr.getvalue().splitlines(), ['Run django-develop inside a virtualenv'])