def test_parse_redis_url(self):
        # full regular
        conf = parse_redis_url("redis://user:password@localhost2:1234/2")
        self.assertEqual(conf.get('HOST'), 'localhost2')
        self.assertEqual(conf.get('DB'), 2)
        self.assertEqual(conf.get('PASSWORD'), 'password')
        self.assertEqual(conf.get('PORT'), 1234)

        # full non local
        conf = parse_redis_url("redis://user:pass@www.localhost.com:1234/2")
        self.assertEqual(conf.get('HOST'), 'www.localhost.com')
        self.assertEqual(conf.get('DB'), 2)
        self.assertEqual(conf.get('PASSWORD'), 'pass')
        self.assertEqual(conf.get('PORT'), 1234)

        # no user name
        conf = parse_redis_url("redis://password@localhost2:1234/2")
        self.assertEqual(conf.get('HOST'), 'localhost2')
        self.assertEqual(conf.get('DB'), 2)
        self.assertEqual(conf.get('PASSWORD'), None)
        self.assertEqual(conf.get('PORT'), 1234)

        # no user name 2 with colon
        conf = parse_redis_url("redis://:password@localhost2:1234/2")
        self.assertEqual(conf.get('HOST'), 'localhost2')
        self.assertEqual(conf.get('DB'), 2)
        self.assertEqual(conf.get('PASSWORD'), 'password')
        self.assertEqual(conf.get('PORT'), 1234)

        # Empty
        conf = parse_redis_url(None)
        self.assertEqual(conf.get('HOST'), 'localhost')
        self.assertEqual(conf.get('DB'), 0)
        self.assertEqual(conf.get('PASSWORD'), None)
        self.assertEqual(conf.get('PORT'), 6379)

        # no db
        conf = parse_redis_url("redis://:password@localhost2:1234")
        self.assertEqual(conf.get('HOST'), 'localhost2')
        self.assertEqual(conf.get('DB'), 0)
        self.assertEqual(conf.get('PASSWORD'), 'password')
        self.assertEqual(conf.get('PORT'), 1234)

        # no password
        conf = parse_redis_url("redis://localhost2:1234/0")
        self.assertEqual(conf.get('HOST'), 'localhost2')
        self.assertEqual(conf.get('DB'), 0)
        self.assertEqual(conf.get('PASSWORD'), None)
        self.assertEqual(conf.get('PORT'), 1234)
endpoint for checking/unchecking any boolean in a sqla model
dataset/ETHPy150Open kencochrane/django-defender/defender/tests.py/AccessAttemptTest.test_parse_redis_url--crossover with--dataset/ETHPy150Open airbnb/caravel/caravel/views.py/Caravel.checkbox