-
-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into CB-448-new-footer
- Loading branch information
Showing
28 changed files
with
306 additions
and
156 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
DELETE FROM comment_revision; | ||
DELETE FROM comment; | ||
DELETE FROM vote; | ||
DELETE FROM spam_report; | ||
DELETE FROM revision; | ||
DELETE FROM oauth_grant; | ||
DELETE FROM oauth_token; | ||
DELETE FROM oauth_client; | ||
DELETE FROM moderation_log; | ||
DELETE FROM review; | ||
DELETE FROM "user"; | ||
DELETE FROM license; | ||
DELETE FROM avg_rating; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,5 @@ | ||
import os | ||
from critiquebrainz.frontend.testing import FrontendTestCase | ||
|
||
from flask_testing import TestCase | ||
|
||
from critiquebrainz.data.utils import create_all, drop_tables, drop_types | ||
from critiquebrainz.frontend import create_app | ||
|
||
|
||
class DataTestCase(TestCase): | ||
|
||
def create_app(self): | ||
app = create_app(config_path=os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', '..', 'test_config.py')) | ||
return app | ||
|
||
def setUp(self): | ||
self.reset_db() | ||
# TODO(roman): Add stuff form fixtures. | ||
|
||
def tearDown(self): | ||
pass | ||
|
||
@staticmethod | ||
def reset_db(): | ||
drop_tables() | ||
drop_types() | ||
create_all() | ||
class DataTestCase(FrontendTestCase): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,17 @@ | ||
import os | ||
from critiquebrainz.ws.oauth import oauth | ||
|
||
from flask_testing import TestCase | ||
|
||
from critiquebrainz.data.utils import create_all, drop_tables, drop_types | ||
from critiquebrainz.frontend import create_app | ||
from critiquebrainz.testing import ServerTestCase | ||
from critiquebrainz.ws.oauth import oauth | ||
|
||
|
||
class FrontendTestCase(TestCase): | ||
class FrontendTestCase(ServerTestCase): | ||
|
||
def create_app(self): | ||
app = create_app(config_path=os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', '..', 'test_config.py')) | ||
@classmethod | ||
def create_app(cls): | ||
app = create_app( | ||
config_path=os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', '..', 'test_config.py') | ||
) | ||
oauth.init_app(app) | ||
app.config['TESTING'] = True | ||
return app | ||
|
||
def setUp(self): | ||
self.reset_db() | ||
# TODO(roman): Add stuff form fixtures. | ||
|
||
def tearDown(self): | ||
pass | ||
|
||
@staticmethod | ||
def reset_db(): | ||
drop_tables() | ||
drop_types() | ||
create_all() | ||
|
||
def temporary_login(self, user): | ||
"""Based on: http://stackoverflow.com/a/16238537.""" | ||
with self.client.session_transaction() as session: | ||
session['_user_id'] = user.id | ||
session['_fresh'] = True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.