def test_should_override_debug(self): old_debug = settings.DEBUG new_debug = not old_debug with override_settings(DEBUG=new_debug): self.assertEqual(settings.DEBUG, new_debug) self.assertEqual(settings.DEBUG, old_debug)
def test_should_return_empty_url_on_django_driver(self): with override_settings(TEST_DRIVER='django'): reload_module(smarttest.testcases) smarttest.testcases.SplinterTestCase.runTest = Mock() obj = smarttest.testcases.SplinterTestCase() result = obj.get_host() self.assertEqual(result, '')
def test_should_return_live_server_url_on_firefox_driver(self): with override_settings(TEST_DRIVER='firefox'): reload_module(smarttest.testcases) smarttest.testcases.SplinterTestCase.runTest = Mock() obj = smarttest.testcases.SplinterTestCase() host = 'localhost' port = '8081' obj.server_thread = Mock(host=host, port=port) result = obj.get_host() self.assertEqual(result, 'http://%s:%s' % (host, port))