Mercurial > public > sg101
diff gpp/antispam/tests/rate_limit_tests.py @ 508:6f5fff924877
Created a centralized spot to get a Redis connection so that settings can be managed in one place.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Sun, 04 Dec 2011 19:53:27 +0000 |
parents | 7c3816d76c6c |
children |
line wrap: on
line diff
--- a/gpp/antispam/tests/rate_limit_tests.py Sun Dec 04 03:05:21 2011 +0000 +++ b/gpp/antispam/tests/rate_limit_tests.py Sun Dec 04 19:53:27 2011 +0000 @@ -2,18 +2,18 @@ Tests for the rate limiting function in the antispam application. """ -import redis from django.test import TestCase from django.core.urlresolvers import reverse from antispam.rate_limit import _make_key +from core.services import get_redis_connection class RateLimitTestCase(TestCase): KEY = _make_key('127.0.0.1') def setUp(self): - self.conn = redis.Redis(host='localhost', port=6379, db=0) + self.conn = get_redis_connection() self.conn.delete(self.KEY) def tearDown(self):