{"action":"created","comment":{"url":"https://api.github.com/repos/deal-thief/deal-thief/pulls/comments/79292345","id":79292345,"diff_hunk":"@@ -0,0 +1,106 @@\n+\"\"\"Conftest file the does the prep work prior tests run.\"\"\"\n+import pytest\n+from passlib.apps import custom_app_context as pwd_context\n+from pyramid import testing\n+from .models import (\n+        User,\n+        Search,\n+        get_engine,\n+        get_session_factory,\n+        get_tm_session\n+)\n+from .models.meta import Base\n+import transaction\n+\n+\n+class MockRequest(object):\n+    \"\"\"MockRequest intended to be a better version of testing.DummyRequest.\"\"\"\n+\n+    def __init__(self, **kwargs):\n+        \"\"\"Init a MockRequest instance.\"\"\"\n+        self.__dict__.update(kwargs)\n+\n+    def route_url(self, string):\n+        \"\"\"Mimic the pyramid.request.Request route_url.\"\"\"\n+        return '/{}'.format(string)\n+\n+\n+class MockSession(object):\n+    def __init__(self, **kwargs):\n+        \"\"\"Init a MockSession instance.\"\"\"\n+        self.flash_msg = []\n+        self.__dict__.update(kwargs)\n+\n+    def flash(self, string):\n+        \"\"\"Mimic the pyramid.session.flash object.\"\"\"\n+        self.flash_msg.append(string)\n+\n+\n+@pytest.fixture(scope='session')\n+def sqlengine(request):\n+    config = testing.setUp(settings={\n+        'sqlalchemy.url': 'sqlite:///:memory:'\n+    })\n+    config.include(\".models\")\n+    settings = config.get_settings()\n+    engine = get_engine(settings)\n+    Base.metadata.create_all(engine)\n+\n+    def teardown():\n+        testing.tearDown()\n+        transaction.abort()\n+        Base.metadata.drop_all(engine)\n+\n+    request.addfinalizer(teardown)\n+    return engine\n+\n+\n+@pytest.fixture(scope='function')\n+def new_session(sqlengine, request):\n+    session_factory = get_session_factory(sqlengine)\n+    session = get_tm_session(session_factory, transaction.manager)\n+\n+    def teardown():\n+        transaction.abort()\n+\n+    request.addfinalizer(teardown)\n+    return session\n+\n+\n+@pytest.fixture(scope='function')\n+def dummy_request(new_session):\n+    \"\"\"Call a dummy request.\"\"\"\n+    test_request = testing.DummyRequest()\n+    test_request.dbsession = new_session\n+    return test_request\n+\n+\n+@pytest.fixture(scope='function')\n+def mock_request(new_session):\n+    \"\"\"Fixture passing mock_request obj to tests.\"\"\"\n+    return MockRequest(\n+            method='POST',\n+            authenticated_userid=None,\n+            dbsession=new_session,\n+            params={},\n+            session=MockSession()\n+    )\n+\n+\n+@pytest.fixture(scope='function')\n+def testapp():\n+    \"\"\"Setup TestApp.\"\"\"\n+    from deal_thief import main\n+    settings = {'sqlalchemy.url': 'sqlite:///:memory:'}\n+    app = main({}, **settings)\n+    from webtest import TestApp\n+    return TestApp(app)\n+\n+\n+@pytest.fixture(scope='function')\n+def test_user():\n+    \"\"\"Create test_user object as an instance of User model.\"\"\"\n+    test_user = User()\n+    test_user.email = 'test@user.com'\n+    test_user.password = pwd_context.encrypt('testpassword')\n+    return test_user","path":"deal_thief/conftest.py","position":106,"original_position":106,"commit_id":"9dd499d96fa086a005d5376c68462bc983049e5a","original_commit_id":"9dd499d96fa086a005d5376c68462bc983049e5a","user":{"login":"cewing","id":417109,"avatar_url":"https://avatars.githubusercontent.com/u/417109?v=3","gravatar_id":"","url":"https://api.github.com/users/cewing","html_url":"https://github.com/cewing","followers_url":"https://api.github.com/users/cewing/followers","following_url":"https://api.github.com/users/cewing/following{/other_user}","gists_url":"https://api.github.com/users/cewing/gists{/gist_id}","starred_url":"https://api.github.com/users/cewing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cewing/subscriptions","organizations_url":"https://api.github.com/users/cewing/orgs","repos_url":"https://api.github.com/users/cewing/repos","events_url":"https://api.github.com/users/cewing/events{/privacy}","received_events_url":"https://api.github.com/users/cewing/received_events","type":"User","site_admin":false},"body":"nice!","created_at":"2016-09-17T21:26:13Z","updated_at":"2016-09-17T21:26:13Z","html_url":"https://github.com/deal-thief/deal-thief/pull/35#discussion_r79292345","pull_request_url":"https://api.github.com/repos/deal-thief/deal-thief/pulls/35","_links":{"self":{"href":"https://api.github.com/repos/deal-thief/deal-thief/pulls/comments/79292345"},"html":{"href":"https://github.com/deal-thief/deal-thief/pull/35#discussion_r79292345"},"pull_request":{"href":"https://api.github.com/repos/deal-thief/deal-thief/pulls/35"}}},"pull_request":{"url":"https://api.github.com/repos/deal-thief/deal-thief/pulls/35","id":84744302,"html_url":"https://github.com/deal-thief/deal-thief/pull/35","diff_url":"https://github.com/deal-thief/deal-thief/pull/35.diff","patch_url":"https://github.com/deal-thief/deal-thief/pull/35.patch","issue_url":"https://api.github.com/repos/deal-thief/deal-thief/issues/35","number":35,"state":"open","locked":false,"title":"For canvas submission","user":{"login":"steventhan","id":18476667,"avatar_url":"https://avatars.githubusercontent.com/u/18476667?v=3","gravatar_id":"","url":"https://api.github.com/users/steventhan","html_url":"https://github.com/steventhan","followers_url":"https://api.github.com/users/steventhan/followers","following_url":"https://api.github.com/users/steventhan/following{/other_user}","gists_url":"https://api.github.com/users/steventhan/gists{/gist_id}","starred_url":"https://api.github.com/users/steventhan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/steventhan/subscriptions","organizations_url":"https://api.github.com/users/steventhan/orgs","repos_url":"https://api.github.com/users/steventhan/repos","events_url":"https://api.github.com/users/steventhan/events{/privacy}","received_events_url":"https://api.github.com/users/steventhan/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-09-10T04:21:09Z","updated_at":"2016-09-17T21:33:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"493d83f0e0f07fe806ff02be087116fbeac2be99","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/deal-thief/deal-thief/pulls/35/commits","review_comments_url":"https://api.github.com/repos/deal-thief/deal-thief/pulls/35/comments","review_comment_url":"https://api.github.com/repos/deal-thief/deal-thief/pulls/comments{/number}","comments_url":"https://api.github.com/repos/deal-thief/deal-thief/issues/35/comments","statuses_url":"https://api.github.com/repos/deal-thief/deal-thief/statuses/9dd499d96fa086a005d5376c68462bc983049e5a","head":{"label":"deal-thief:development","ref":"development","sha":"9dd499d96fa086a005d5376c68462bc983049e5a","user":{"login":"deal-thief","id":21251263,"avatar_url":"https://avatars.githubusercontent.com/u/21251263?v=3","gravatar_id":"","url":"https://api.github.com/users/deal-thief","html_url":"https://github.com/deal-thief","followers_url":"https://api.github.com/users/deal-thief/followers","following_url":"https://api.github.com/users/deal-thief/following{/other_user}","gists_url":"https://api.github.com/users/deal-thief/gists{/gist_id}","starred_url":"https://api.github.com/users/deal-thief/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deal-thief/subscriptions","organizations_url":"https://api.github.com/users/deal-thief/orgs","repos_url":"https://api.github.com/users/deal-thief/repos","events_url":"https://api.github.com/users/deal-thief/events{/privacy}","received_events_url":"https://api.github.com/users/deal-thief/received_events","type":"Organization","site_admin":false},"repo":{"id":66600496,"name":"deal-thief","full_name":"deal-thief/deal-thief","owner":{"login":"deal-thief","id":21251263,"avatar_url":"https://avatars.githubusercontent.com/u/21251263?v=3","gravatar_id":"","url":"https://api.github.com/users/deal-thief","html_url":"https://github.com/deal-thief","followers_url":"https://api.github.com/users/deal-thief/followers","following_url":"https://api.github.com/users/deal-thief/following{/other_user}","gists_url":"https://api.github.com/users/deal-thief/gists{/gist_id}","starred_url":"https://api.github.com/users/deal-thief/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deal-thief/subscriptions","organizations_url":"https://api.github.com/users/deal-thief/orgs","repos_url":"https://api.github.com/users/deal-thief/repos","events_url":"https://api.github.com/users/deal-thief/events{/privacy}","received_events_url":"https://api.github.com/users/deal-thief/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/deal-thief/deal-thief","description":"Robbery","fork":false,"url":"https://api.github.com/repos/deal-thief/deal-thief","forks_url":"https://api.github.com/repos/deal-thief/deal-thief/forks","keys_url":"https://api.github.com/repos/deal-thief/deal-thief/keys{/key_id}","collaborators_url":"https://api.github.com/repos/deal-thief/deal-thief/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/deal-thief/deal-thief/teams","hooks_url":"https://api.github.com/repos/deal-thief/deal-thief/hooks","issue_events_url":"https://api.github.com/repos/deal-thief/deal-thief/issues/events{/number}","events_url":"https://api.github.com/repos/deal-thief/deal-thief/events","assignees_url":"https://api.github.com/repos/deal-thief/deal-thief/assignees{/user}","branches_url":"https://api.github.com/repos/deal-thief/deal-thief/branches{/branch}","tags_url":"https://api.github.com/repos/deal-thief/deal-thief/tags","blobs_url":"https://api.github.com/repos/deal-thief/deal-thief/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/deal-thief/deal-thief/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/deal-thief/deal-thief/git/refs{/sha}","trees_url":"https://api.github.com/repos/deal-thief/deal-thief/git/trees{/sha}","statuses_url":"https://api.github.com/repos/deal-thief/deal-thief/statuses/{sha}","languages_url":"https://api.github.com/repos/deal-thief/deal-thief/languages","stargazers_url":"https://api.github.com/repos/deal-thief/deal-thief/stargazers","contributors_url":"https://api.github.com/repos/deal-thief/deal-thief/contributors","subscribers_url":"https://api.github.com/repos/deal-thief/deal-thief/subscribers","subscription_url":"https://api.github.com/repos/deal-thief/deal-thief/subscription","commits_url":"https://api.github.com/repos/deal-thief/deal-thief/commits{/sha}","git_commits_url":"https://api.github.com/repos/deal-thief/deal-thief/git/commits{/sha}","comments_url":"https://api.github.com/repos/deal-thief/deal-thief/comments{/number}","issue_comment_url":"https://api.github.com/repos/deal-thief/deal-thief/issues/comments{/number}","contents_url":"https://api.github.com/repos/deal-thief/deal-thief/contents/{+path}","compare_url":"https://api.github.com/repos/deal-thief/deal-thief/compare/{base}...{head}","merges_url":"https://api.github.com/repos/deal-thief/deal-thief/merges","archive_url":"https://api.github.com/repos/deal-thief/deal-thief/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/deal-thief/deal-thief/downloads","issues_url":"https://api.github.com/repos/deal-thief/deal-thief/issues{/number}","pulls_url":"https://api.github.com/repos/deal-thief/deal-thief/pulls{/number}","milestones_url":"https://api.github.com/repos/deal-thief/deal-thief/milestones{/number}","notifications_url":"https://api.github.com/repos/deal-thief/deal-thief/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/deal-thief/deal-thief/labels{/name}","releases_url":"https://api.github.com/repos/deal-thief/deal-thief/releases{/id}","deployments_url":"https://api.github.com/repos/deal-thief/deal-thief/deployments","created_at":"2016-08-25T23:34:20Z","updated_at":"2016-09-03T23:47:07Z","pushed_at":"2016-09-10T04:21:09Z","git_url":"git://github.com/deal-thief/deal-thief.git","ssh_url":"git@github.com:deal-thief/deal-thief.git","clone_url":"https://github.com/deal-thief/deal-thief.git","svn_url":"https://github.com/deal-thief/deal-thief","homepage":null,"size":2283,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":2,"default_branch":"development"}},"base":{"label":"deal-thief:master","ref":"master","sha":"fdcfc86c3b317a451395a1e1cb4020b2f79c1d7b","user":{"login":"deal-thief","id":21251263,"avatar_url":"https://avatars.githubusercontent.com/u/21251263?v=3","gravatar_id":"","url":"https://api.github.com/users/deal-thief","html_url":"https://github.com/deal-thief","followers_url":"https://api.github.com/users/deal-thief/followers","following_url":"https://api.github.com/users/deal-thief/following{/other_user}","gists_url":"https://api.github.com/users/deal-thief/gists{/gist_id}","starred_url":"https://api.github.com/users/deal-thief/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deal-thief/subscriptions","organizations_url":"https://api.github.com/users/deal-thief/orgs","repos_url":"https://api.github.com/users/deal-thief/repos","events_url":"https://api.github.com/users/deal-thief/events{/privacy}","received_events_url":"https://api.github.com/users/deal-thief/received_events","type":"Organization","site_admin":false},"repo":{"id":66600496,"name":"deal-thief","full_name":"deal-thief/deal-thief","owner":{"login":"deal-thief","id":21251263,"avatar_url":"https://avatars.githubusercontent.com/u/21251263?v=3","gravatar_id":"","url":"https://api.github.com/users/deal-thief","html_url":"https://github.com/deal-thief","followers_url":"https://api.github.com/users/deal-thief/followers","following_url":"https://api.github.com/users/deal-thief/following{/other_user}","gists_url":"https://api.github.com/users/deal-thief/gists{/gist_id}","starred_url":"https://api.github.com/users/deal-thief/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deal-thief/subscriptions","organizations_url":"https://api.github.com/users/deal-thief/orgs","repos_url":"https://api.github.com/users/deal-thief/repos","events_url":"https://api.github.com/users/deal-thief/events{/privacy}","received_events_url":"https://api.github.com/users/deal-thief/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/deal-thief/deal-thief","description":"Robbery","fork":false,"url":"https://api.github.com/repos/deal-thief/deal-thief","forks_url":"https://api.github.com/repos/deal-thief/deal-thief/forks","keys_url":"https://api.github.com/repos/deal-thief/deal-thief/keys{/key_id}","collaborators_url":"https://api.github.com/repos/deal-thief/deal-thief/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/deal-thief/deal-thief/teams","hooks_url":"https://api.github.com/repos/deal-thief/deal-thief/hooks","issue_events_url":"https://api.github.com/repos/deal-thief/deal-thief/issues/events{/number}","events_url":"https://api.github.com/repos/deal-thief/deal-thief/events","assignees_url":"https://api.github.com/repos/deal-thief/deal-thief/assignees{/user}","branches_url":"https://api.github.com/repos/deal-thief/deal-thief/branches{/branch}","tags_url":"https://api.github.com/repos/deal-thief/deal-thief/tags","blobs_url":"https://api.github.com/repos/deal-thief/deal-thief/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/deal-thief/deal-thief/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/deal-thief/deal-thief/git/refs{/sha}","trees_url":"https://api.github.com/repos/deal-thief/deal-thief/git/trees{/sha}","statuses_url":"https://api.github.com/repos/deal-thief/deal-thief/statuses/{sha}","languages_url":"https://api.github.com/repos/deal-thief/deal-thief/languages","stargazers_url":"https://api.github.com/repos/deal-thief/deal-thief/stargazers","contributors_url":"https://api.github.com/repos/deal-thief/deal-thief/contributors","subscribers_url":"https://api.github.com/repos/deal-thief/deal-thief/subscribers","subscription_url":"https://api.github.com/repos/deal-thief/deal-thief/subscription","commits_url":"https://api.github.com/repos/deal-thief/deal-thief/commits{/sha}","git_commits_url":"https://api.github.com/repos/deal-thief/deal-thief/git/commits{/sha}","comments_url":"https://api.github.com/repos/deal-thief/deal-thief/comments{/number}","issue_comment_url":"https://api.github.com/repos/deal-thief/deal-thief/issues/comments{/number}","contents_url":"https://api.github.com/repos/deal-thief/deal-thief/contents/{+path}","compare_url":"https://api.github.com/repos/deal-thief/deal-thief/compare/{base}...{head}","merges_url":"https://api.github.com/repos/deal-thief/deal-thief/merges","archive_url":"https://api.github.com/repos/deal-thief/deal-thief/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/deal-thief/deal-thief/downloads","issues_url":"https://api.github.com/repos/deal-thief/deal-thief/issues{/number}","pulls_url":"https://api.github.com/repos/deal-thief/deal-thief/pulls{/number}","milestones_url":"https://api.github.com/repos/deal-thief/deal-thief/milestones{/number}","notifications_url":"https://api.github.com/repos/deal-thief/deal-thief/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/deal-thief/deal-thief/labels{/name}","releases_url":"https://api.github.com/repos/deal-thief/deal-thief/releases{/id}","deployments_url":"https://api.github.com/repos/deal-thief/deal-thief/deployments","created_at":"2016-08-25T23:34:20Z","updated_at":"2016-09-03T23:47:07Z","pushed_at":"2016-09-10T04:21:09Z","git_url":"git://github.com/deal-thief/deal-thief.git","ssh_url":"git@github.com:deal-thief/deal-thief.git","clone_url":"https://github.com/deal-thief/deal-thief.git","svn_url":"https://github.com/deal-thief/deal-thief","homepage":null,"size":2283,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":2,"default_branch":"development"}},"_links":{"self":{"href":"https://api.github.com/repos/deal-thief/deal-thief/pulls/35"},"html":{"href":"https://github.com/deal-thief/deal-thief/pull/35"},"issue":{"href":"https://api.github.com/repos/deal-thief/deal-thief/issues/35"},"comments":{"href":"https://api.github.com/repos/deal-thief/deal-thief/issues/35/comments"},"review_comments":{"href":"https://api.github.com/repos/deal-thief/deal-thief/pulls/35/comments"},"review_comment":{"href":"https://api.github.com/repos/deal-thief/deal-thief/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/deal-thief/deal-thief/pulls/35/commits"},"statuses":{"href":"https://api.github.com/repos/deal-thief/deal-thief/statuses/9dd499d96fa086a005d5376c68462bc983049e5a"}}}}
{"actor":{"display_login":"cewing"}}