Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the same database for all tests when testing MongoDB #835

Merged
merged 1 commit into from
Jul 11, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions tests/base_case.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,6 @@ def get_kwargs(self):
'database': None
}

def random_string(self, start=0, end=9000):
"""
Generate a string based on a random number.
"""
from random import randint
return str(randint(start, end))


class ChatBotMongoTestCase(ChatBotTestCase):

Expand All @@ -58,7 +51,7 @@ def setUpClass(cls):

def get_kwargs(self):
kwargs = super(ChatBotMongoTestCase, self).get_kwargs()
kwargs['database'] = self.random_string()
kwargs['database'] = 'chatterbot_test_database'
kwargs['storage_adapter'] = 'chatterbot.storage.MongoDatabaseAdapter'
return kwargs

Expand Down