{"action":"created","comment":{"url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/pulls/comments/53938467","id":53938467,"diff_hunk":"@@ -0,0 +1,37 @@\n+import unittest\n+import mongomock\n+import mongoengine\n+from pymongo.errors import InvalidURI\n+from distutils.version import StrictVersion\n+from flask.ext.mongoengine import MongoEngine\n+from tests import FlaskMongoEngineTestCase\n+\n+class ConnectionTestCase(FlaskMongoEngineTestCase):\n+\n+\tdef test_ignore_parse_uri_if_testing_true_and_uses_mongomock_schema(self):\n+\t\tself.app.config['TESTING'] = True\n+\t\tself.app.config['MONGODB_ALIAS'] = 'unittest'\n+\t\tself.app.config['MONGODB_HOST'] = 'mongomock://localhost'\n+\n+\t\tif StrictVersion(mongoengine.__version__) >= StrictVersion('0.10.6'):\n+\t\t\tdb = MongoEngine(self.app)\n+\t\t\tself.assertTrue(isinstance(db.connection, mongomock.MongoClient))\n+\n+\tdef test_parse_uri_if_testing_true_and_not_uses_mongomock_schema(self):\n+\t\tself.app.config['TESTING'] = True\n+\t\tself.app.config['MONGODB_ALIAS'] = 'unittest'\n+\t\tself.app.config['MONGODB_HOST'] = 'mongo://localhost'\n+\n+\t\twith self.assertRaises(InvalidURI):\n+\t\t\tdb = MongoEngine(self.app)\n+\n+\tdef test_parse_uri_if_testing_is_not_true(self):\n+\t\tself.app.config['TESTING'] = False\n+\t\tself.app.config['MONGODB_ALIAS'] = 'unittest'\n+\t\tself.app.config['MONGODB_HOST'] = 'mongomock://localhost'\n+        \n+\t\twith self.assertRaises(InvalidURI):\n+\t\t\tdb = MongoEngine(self.app)","path":"tests/test_connection.py","position":34,"original_position":34,"commit_id":"2f3fd755da3f1c02e25801e3718ffa3ebe55e622","original_commit_id":"2f3fd755da3f1c02e25801e3718ffa3ebe55e622","user":{"login":"losintikfos","id":3749795,"avatar_url":"https://avatars.githubusercontent.com/u/3749795?v=3","gravatar_id":"","url":"https://api.github.com/users/losintikfos","html_url":"https://github.com/losintikfos","followers_url":"https://api.github.com/users/losintikfos/followers","following_url":"https://api.github.com/users/losintikfos/following{/other_user}","gists_url":"https://api.github.com/users/losintikfos/gists{/gist_id}","starred_url":"https://api.github.com/users/losintikfos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/losintikfos/subscriptions","organizations_url":"https://api.github.com/users/losintikfos/orgs","repos_url":"https://api.github.com/users/losintikfos/repos","events_url":"https://api.github.com/users/losintikfos/events{/privacy}","received_events_url":"https://api.github.com/users/losintikfos/received_events","type":"User","site_admin":false},"body":"Possibly same as above maybe?","created_at":"2016-02-24T13:37:39Z","updated_at":"2016-02-24T13:37:39Z","html_url":"https://github.com/MongoEngine/flask-mongoengine/pull/205#discussion_r53938467","pull_request_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/pulls/205","_links":{"self":{"href":"https://api.github.com/repos/MongoEngine/flask-mongoengine/pulls/comments/53938467"},"html":{"href":"https://github.com/MongoEngine/flask-mongoengine/pull/205#discussion_r53938467"},"pull_request":{"href":"https://api.github.com/repos/MongoEngine/flask-mongoengine/pulls/205"}}},"pull_request":{"url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/pulls/205","id":60450448,"html_url":"https://github.com/MongoEngine/flask-mongoengine/pull/205","diff_url":"https://github.com/MongoEngine/flask-mongoengine/pull/205.diff","patch_url":"https://github.com/MongoEngine/flask-mongoengine/pull/205.patch","issue_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/issues/205","number":205,"state":"open","locked":false,"title":"ignoring parse_uri if testing config is true and uses mongomock uri schema","user":{"login":"brunobelarmino","id":5875026,"avatar_url":"https://avatars.githubusercontent.com/u/5875026?v=3","gravatar_id":"","url":"https://api.github.com/users/brunobelarmino","html_url":"https://github.com/brunobelarmino","followers_url":"https://api.github.com/users/brunobelarmino/followers","following_url":"https://api.github.com/users/brunobelarmino/following{/other_user}","gists_url":"https://api.github.com/users/brunobelarmino/gists{/gist_id}","starred_url":"https://api.github.com/users/brunobelarmino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brunobelarmino/subscriptions","organizations_url":"https://api.github.com/users/brunobelarmino/orgs","repos_url":"https://api.github.com/users/brunobelarmino/repos","events_url":"https://api.github.com/users/brunobelarmino/events{/privacy}","received_events_url":"https://api.github.com/users/brunobelarmino/received_events","type":"User","site_admin":false},"body":"Ignoring pymongo uri validation if app.config['TESTING'] is True and either app.config['MONGODB_HOST'] or app.config['MONGODB_SETTINGS'] = { 'host': ''} is set to mongomock uri schema (mongomock://).\r\n\r\nSolves issue #98.","created_at":"2016-02-24T03:24:19Z","updated_at":"2016-02-24T13:37:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7eac29aa770f45861e5b8a406b49ff19d049e062","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/pulls/205/commits","review_comments_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/pulls/205/comments","review_comment_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/pulls/comments{/number}","comments_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/issues/205/comments","statuses_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/statuses/2f3fd755da3f1c02e25801e3718ffa3ebe55e622","head":{"label":"brunobelarmino:mongomock","ref":"mongomock","sha":"2f3fd755da3f1c02e25801e3718ffa3ebe55e622","user":{"login":"brunobelarmino","id":5875026,"avatar_url":"https://avatars.githubusercontent.com/u/5875026?v=3","gravatar_id":"","url":"https://api.github.com/users/brunobelarmino","html_url":"https://github.com/brunobelarmino","followers_url":"https://api.github.com/users/brunobelarmino/followers","following_url":"https://api.github.com/users/brunobelarmino/following{/other_user}","gists_url":"https://api.github.com/users/brunobelarmino/gists{/gist_id}","starred_url":"https://api.github.com/users/brunobelarmino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brunobelarmino/subscriptions","organizations_url":"https://api.github.com/users/brunobelarmino/orgs","repos_url":"https://api.github.com/users/brunobelarmino/repos","events_url":"https://api.github.com/users/brunobelarmino/events{/privacy}","received_events_url":"https://api.github.com/users/brunobelarmino/received_events","type":"User","site_admin":false},"repo":{"id":52399184,"name":"flask-mongoengine","full_name":"brunobelarmino/flask-mongoengine","owner":{"login":"brunobelarmino","id":5875026,"avatar_url":"https://avatars.githubusercontent.com/u/5875026?v=3","gravatar_id":"","url":"https://api.github.com/users/brunobelarmino","html_url":"https://github.com/brunobelarmino","followers_url":"https://api.github.com/users/brunobelarmino/followers","following_url":"https://api.github.com/users/brunobelarmino/following{/other_user}","gists_url":"https://api.github.com/users/brunobelarmino/gists{/gist_id}","starred_url":"https://api.github.com/users/brunobelarmino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brunobelarmino/subscriptions","organizations_url":"https://api.github.com/users/brunobelarmino/orgs","repos_url":"https://api.github.com/users/brunobelarmino/repos","events_url":"https://api.github.com/users/brunobelarmino/events{/privacy}","received_events_url":"https://api.github.com/users/brunobelarmino/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/brunobelarmino/flask-mongoengine","description":"MongoEngine flask extension with WTF model forms support","fork":true,"url":"https://api.github.com/repos/brunobelarmino/flask-mongoengine","forks_url":"https://api.github.com/repos/brunobelarmino/flask-mongoengine/forks","keys_url":"https://api.github.com/repos/brunobelarmino/flask-mongoengine/keys{/key_id}","collaborators_url":"https://api.github.com/repos/brunobelarmino/flask-mongoengine/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/brunobelarmino/flask-mongoengine/teams","hooks_url":"https://api.github.com/repos/brunobelarmino/flask-mongoengine/hooks","issue_events_url":"https://api.github.com/repos/brunobelarmino/flask-mongoengine/issues/events{/number}","events_url":"https://api.github.com/repos/brunobelarmino/flask-mongoengine/events","assignees_url":"https://api.github.com/repos/brunobelarmino/flask-mongoengine/assignees{/user}","branches_url":"https://api.github.com/repos/brunobelarmino/flask-mongoengine/branches{/branch}","tags_url":"https://api.github.com/repos/brunobelarmino/flask-mongoengine/tags","blobs_url":"https://api.github.com/repos/brunobelarmino/flask-mongoengine/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/brunobelarmino/flask-mongoengine/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/brunobelarmino/flask-mongoengine/git/refs{/sha}","trees_url":"https://api.github.com/repos/brunobelarmino/flask-mongoengine/git/trees{/sha}","statuses_url":"https://api.github.com/repos/brunobelarmino/flask-mongoengine/statuses/{sha}","languages_url":"https://api.github.com/repos/brunobelarmino/flask-mongoengine/languages","stargazers_url":"https://api.github.com/repos/brunobelarmino/flask-mongoengine/stargazers","contributors_url":"https://api.github.com/repos/brunobelarmino/flask-mongoengine/contributors","subscribers_url":"https://api.github.com/repos/brunobelarmino/flask-mongoengine/subscribers","subscription_url":"https://api.github.com/repos/brunobelarmino/flask-mongoengine/subscription","commits_url":"https://api.github.com/repos/brunobelarmino/flask-mongoengine/commits{/sha}","git_commits_url":"https://api.github.com/repos/brunobelarmino/flask-mongoengine/git/commits{/sha}","comments_url":"https://api.github.com/repos/brunobelarmino/flask-mongoengine/comments{/number}","issue_comment_url":"https://api.github.com/repos/brunobelarmino/flask-mongoengine/issues/comments{/number}","contents_url":"https://api.github.com/repos/brunobelarmino/flask-mongoengine/contents/{+path}","compare_url":"https://api.github.com/repos/brunobelarmino/flask-mongoengine/compare/{base}...{head}","merges_url":"https://api.github.com/repos/brunobelarmino/flask-mongoengine/merges","archive_url":"https://api.github.com/repos/brunobelarmino/flask-mongoengine/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/brunobelarmino/flask-mongoengine/downloads","issues_url":"https://api.github.com/repos/brunobelarmino/flask-mongoengine/issues{/number}","pulls_url":"https://api.github.com/repos/brunobelarmino/flask-mongoengine/pulls{/number}","milestones_url":"https://api.github.com/repos/brunobelarmino/flask-mongoengine/milestones{/number}","notifications_url":"https://api.github.com/repos/brunobelarmino/flask-mongoengine/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/brunobelarmino/flask-mongoengine/labels{/name}","releases_url":"https://api.github.com/repos/brunobelarmino/flask-mongoengine/releases{/id}","deployments_url":"https://api.github.com/repos/brunobelarmino/flask-mongoengine/deployments","created_at":"2016-02-23T23:24:52Z","updated_at":"2016-02-23T23:24:53Z","pushed_at":"2016-02-24T03:21:37Z","git_url":"git://github.com/brunobelarmino/flask-mongoengine.git","ssh_url":"git@github.com:brunobelarmino/flask-mongoengine.git","clone_url":"https://github.com/brunobelarmino/flask-mongoengine.git","svn_url":"https://github.com/brunobelarmino/flask-mongoengine","homepage":"","size":396,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"MongoEngine:master","ref":"master","sha":"a842dc507b3e5b18a4b1ce3adc792a24d3983d6c","user":{"login":"MongoEngine","id":1502485,"avatar_url":"https://avatars.githubusercontent.com/u/1502485?v=3","gravatar_id":"","url":"https://api.github.com/users/MongoEngine","html_url":"https://github.com/MongoEngine","followers_url":"https://api.github.com/users/MongoEngine/followers","following_url":"https://api.github.com/users/MongoEngine/following{/other_user}","gists_url":"https://api.github.com/users/MongoEngine/gists{/gist_id}","starred_url":"https://api.github.com/users/MongoEngine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MongoEngine/subscriptions","organizations_url":"https://api.github.com/users/MongoEngine/orgs","repos_url":"https://api.github.com/users/MongoEngine/repos","events_url":"https://api.github.com/users/MongoEngine/events{/privacy}","received_events_url":"https://api.github.com/users/MongoEngine/received_events","type":"Organization","site_admin":false},"repo":{"id":4335022,"name":"flask-mongoengine","full_name":"MongoEngine/flask-mongoengine","owner":{"login":"MongoEngine","id":1502485,"avatar_url":"https://avatars.githubusercontent.com/u/1502485?v=3","gravatar_id":"","url":"https://api.github.com/users/MongoEngine","html_url":"https://github.com/MongoEngine","followers_url":"https://api.github.com/users/MongoEngine/followers","following_url":"https://api.github.com/users/MongoEngine/following{/other_user}","gists_url":"https://api.github.com/users/MongoEngine/gists{/gist_id}","starred_url":"https://api.github.com/users/MongoEngine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MongoEngine/subscriptions","organizations_url":"https://api.github.com/users/MongoEngine/orgs","repos_url":"https://api.github.com/users/MongoEngine/repos","events_url":"https://api.github.com/users/MongoEngine/events{/privacy}","received_events_url":"https://api.github.com/users/MongoEngine/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/MongoEngine/flask-mongoengine","description":"MongoEngine flask extension with WTF model forms support","fork":false,"url":"https://api.github.com/repos/MongoEngine/flask-mongoengine","forks_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/forks","keys_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/teams","hooks_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/hooks","issue_events_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/issues/events{/number}","events_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/events","assignees_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/assignees{/user}","branches_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/branches{/branch}","tags_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/tags","blobs_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/git/refs{/sha}","trees_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/statuses/{sha}","languages_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/languages","stargazers_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/stargazers","contributors_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/contributors","subscribers_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/subscribers","subscription_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/subscription","commits_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/commits{/sha}","git_commits_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/git/commits{/sha}","comments_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/comments{/number}","issue_comment_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/issues/comments{/number}","contents_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/contents/{+path}","compare_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/merges","archive_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/downloads","issues_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/issues{/number}","pulls_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/pulls{/number}","milestones_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/milestones{/number}","notifications_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/labels{/name}","releases_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/releases{/id}","deployments_url":"https://api.github.com/repos/MongoEngine/flask-mongoengine/deployments","created_at":"2012-05-15T11:33:26Z","updated_at":"2016-02-24T00:35:55Z","pushed_at":"2016-02-24T13:32:25Z","git_url":"git://github.com/MongoEngine/flask-mongoengine.git","ssh_url":"git@github.com:MongoEngine/flask-mongoengine.git","clone_url":"https://github.com/MongoEngine/flask-mongoengine.git","svn_url":"https://github.com/MongoEngine/flask-mongoengine","homepage":"","size":577,"stargazers_count":324,"watchers_count":324,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":134,"mirror_url":null,"open_issues_count":31,"forks":134,"open_issues":31,"watchers":324,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/MongoEngine/flask-mongoengine/pulls/205"},"html":{"href":"https://github.com/MongoEngine/flask-mongoengine/pull/205"},"issue":{"href":"https://api.github.com/repos/MongoEngine/flask-mongoengine/issues/205"},"comments":{"href":"https://api.github.com/repos/MongoEngine/flask-mongoengine/issues/205/comments"},"review_comments":{"href":"https://api.github.com/repos/MongoEngine/flask-mongoengine/pulls/205/comments"},"review_comment":{"href":"https://api.github.com/repos/MongoEngine/flask-mongoengine/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/MongoEngine/flask-mongoengine/pulls/205/commits"},"statuses":{"href":"https://api.github.com/repos/MongoEngine/flask-mongoengine/statuses/2f3fd755da3f1c02e25801e3718ffa3ebe55e622"}}}}