Prevent accessing not yet configured settings in django.MongoTestCase
This commit is contained in:
parent
b2a2735034
commit
0d81e7933e
@ -26,7 +26,11 @@ class MongoTestCase(TestCase):
|
|||||||
"""
|
"""
|
||||||
TestCase class that clear the collection between the tests
|
TestCase class that clear the collection between the tests
|
||||||
"""
|
"""
|
||||||
db_name = 'test_%s' % settings.MONGO_DATABASE_NAME
|
|
||||||
|
@property
|
||||||
|
def db_name(self):
|
||||||
|
return 'test_%s' % settings.MONGO_DATABASE_NAME
|
||||||
|
|
||||||
def __init__(self, methodName='runtest'):
|
def __init__(self, methodName='runtest'):
|
||||||
self.db = connect(self.db_name).get_db()
|
self.db = connect(self.db_name).get_db()
|
||||||
super(MongoTestCase, self).__init__(methodName)
|
super(MongoTestCase, self).__init__(methodName)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user