def test_get_cwd(self): """ This is a bad test """ template_server = TemplateServer() cwd = template_server.get_cwd() self.assertIsNotNone(cwd)
class Command(BaseCommand): def __init__(self): super().__init__() self.server = TemplateServer() def handle(self, *args, **options): atexit.register(self.server.terminate) self.server.start() while True: sleep(1)
def test_get_options(self): """ Test get options, including custom renderer """ template_server = TemplateServer() options = template_server.get_options() expected = ['debug=False'] self.assertEqual(options, expected) with self.settings(DJANGO_ISOMORPHIC_RENDERER='test.js'): options = template_server.get_options() expected = ['debug=False', 'renderer=test.js'] self.assertListEqual(options, expected)
def __init__(self): super().__init__() self.server = TemplateServer()