{"action":"created","comment":{"url":"https://api.github.com/repos/kvesteri/postgresql-audit/pulls/comments/44377827","id":44377827,"diff_hunk":"@@ -0,0 +1,177 @@\n+# -*- coding: utf-8 -*-\n+\n+import pytest\n+import sqlalchemy as sa\n+from sqlalchemy.ext.declarative import declarative_base\n+\n+from postgresql_audit import VersioningManager\n+\n+from .utils import last_activity\n+\n+\n+@pytest.fixture()\n+def cs_name():\n+    return 'audit'\n+\n+\n+@pytest.fixture()\n+def cs_versioning_manager(cs_name):\n+    return VersioningManager(schema_name=cs_name)\n+\n+\n+@pytest.yield_fixture()\n+def cs_activity_cls(base, cs_versioning_manager):\n+    cs_versioning_manager.init(base)\n+    yield cs_versioning_manager.activity_cls\n+    cs_versioning_manager.remove_listeners()\n+\n+\n+@pytest.yield_fixture()\n+def cs_table_creator(base, connection, session, models, cs_versioning_manager,\n+                     cs_name):\n+    sa.orm.configure_mappers()\n+    connection.execute('DROP SCHEMA IF EXISTS {} CASCADE'.format(cs_name))\n+    tx = connection.begin()\n+    cs_versioning_manager.activity_cls.__table__.create(connection)\n+    base.metadata.create_all(connection)\n+    tx.commit()\n+    yield\n+    base.metadata.drop_all(connection)\n+    session.commit()\n+\n+\n+@pytest.mark.usefixtures('cs_activity_cls',\n+                         'cs_table_creator')\n+class TestCustomSchemaActivityCreation(object):\n+\n+    def test_cs_insert(self, user, connection, cs_name):","path":"tests/test_custom_schema.py","position":47,"original_position":47,"commit_id":"562aa7b3bdda36190cc7abbb5146b3665c0ecb8b","original_commit_id":"562aa7b3bdda36190cc7abbb5146b3665c0ecb8b","user":{"login":"kvesteri","id":398714,"avatar_url":"https://avatars.githubusercontent.com/u/398714?v=3","gravatar_id":"","url":"https://api.github.com/users/kvesteri","html_url":"https://github.com/kvesteri","followers_url":"https://api.github.com/users/kvesteri/followers","following_url":"https://api.github.com/users/kvesteri/following{/other_user}","gists_url":"https://api.github.com/users/kvesteri/gists{/gist_id}","starred_url":"https://api.github.com/users/kvesteri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kvesteri/subscriptions","organizations_url":"https://api.github.com/users/kvesteri/orgs","repos_url":"https://api.github.com/users/kvesteri/repos","events_url":"https://api.github.com/users/kvesteri/events{/privacy}","received_events_url":"https://api.github.com/users/kvesteri/received_events","type":"User","site_admin":false},"body":"I think we could remove the cs prefix from these methods. It is implicitly clear from the class name. ","created_at":"2015-11-10T07:50:27Z","updated_at":"2015-11-10T07:50:27Z","html_url":"https://github.com/kvesteri/postgresql-audit/pull/4#discussion_r44377827","pull_request_url":"https://api.github.com/repos/kvesteri/postgresql-audit/pulls/4","_links":{"self":{"href":"https://api.github.com/repos/kvesteri/postgresql-audit/pulls/comments/44377827"},"html":{"href":"https://github.com/kvesteri/postgresql-audit/pull/4#discussion_r44377827"},"pull_request":{"href":"https://api.github.com/repos/kvesteri/postgresql-audit/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/kvesteri/postgresql-audit/pulls/4","id":48856117,"html_url":"https://github.com/kvesteri/postgresql-audit/pull/4","diff_url":"https://github.com/kvesteri/postgresql-audit/pull/4.diff","patch_url":"https://github.com/kvesteri/postgresql-audit/pull/4.patch","issue_url":"https://api.github.com/repos/kvesteri/postgresql-audit/issues/4","number":4,"state":"open","locked":false,"title":"Remove hard-coded database schema","user":{"login":"jmagnusson","id":190835,"avatar_url":"https://avatars.githubusercontent.com/u/190835?v=3","gravatar_id":"","url":"https://api.github.com/users/jmagnusson","html_url":"https://github.com/jmagnusson","followers_url":"https://api.github.com/users/jmagnusson/followers","following_url":"https://api.github.com/users/jmagnusson/following{/other_user}","gists_url":"https://api.github.com/users/jmagnusson/gists{/gist_id}","starred_url":"https://api.github.com/users/jmagnusson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmagnusson/subscriptions","organizations_url":"https://api.github.com/users/jmagnusson/orgs","repos_url":"https://api.github.com/users/jmagnusson/repos","events_url":"https://api.github.com/users/jmagnusson/events{/privacy}","received_events_url":"https://api.github.com/users/jmagnusson/received_events","type":"User","site_admin":false},"body":"Makes the code more portable by not using a specifying a schema anywhere. In response to the discussion in #3.\r\n\r\nI also took the liberty to add tox and requirements files plus an instruction on how to run the tests. I can revert this if it's not the way you want it.","created_at":"2015-10-27T11:07:22Z","updated_at":"2015-11-10T07:50:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5331a9ff66f6c7c7d554d2c7ef4e483879b5ba8d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/kvesteri/postgresql-audit/pulls/4/commits","review_comments_url":"https://api.github.com/repos/kvesteri/postgresql-audit/pulls/4/comments","review_comment_url":"https://api.github.com/repos/kvesteri/postgresql-audit/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kvesteri/postgresql-audit/issues/4/comments","statuses_url":"https://api.github.com/repos/kvesteri/postgresql-audit/statuses/562aa7b3bdda36190cc7abbb5146b3665c0ecb8b","head":{"label":"jmagnusson:no-schema","ref":"no-schema","sha":"562aa7b3bdda36190cc7abbb5146b3665c0ecb8b","user":{"login":"jmagnusson","id":190835,"avatar_url":"https://avatars.githubusercontent.com/u/190835?v=3","gravatar_id":"","url":"https://api.github.com/users/jmagnusson","html_url":"https://github.com/jmagnusson","followers_url":"https://api.github.com/users/jmagnusson/followers","following_url":"https://api.github.com/users/jmagnusson/following{/other_user}","gists_url":"https://api.github.com/users/jmagnusson/gists{/gist_id}","starred_url":"https://api.github.com/users/jmagnusson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmagnusson/subscriptions","organizations_url":"https://api.github.com/users/jmagnusson/orgs","repos_url":"https://api.github.com/users/jmagnusson/repos","events_url":"https://api.github.com/users/jmagnusson/events{/privacy}","received_events_url":"https://api.github.com/users/jmagnusson/received_events","type":"User","site_admin":false},"repo":{"id":45026549,"name":"postgresql-audit","full_name":"jmagnusson/postgresql-audit","owner":{"login":"jmagnusson","id":190835,"avatar_url":"https://avatars.githubusercontent.com/u/190835?v=3","gravatar_id":"","url":"https://api.github.com/users/jmagnusson","html_url":"https://github.com/jmagnusson","followers_url":"https://api.github.com/users/jmagnusson/followers","following_url":"https://api.github.com/users/jmagnusson/following{/other_user}","gists_url":"https://api.github.com/users/jmagnusson/gists{/gist_id}","starred_url":"https://api.github.com/users/jmagnusson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmagnusson/subscriptions","organizations_url":"https://api.github.com/users/jmagnusson/orgs","repos_url":"https://api.github.com/users/jmagnusson/repos","events_url":"https://api.github.com/users/jmagnusson/events{/privacy}","received_events_url":"https://api.github.com/users/jmagnusson/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jmagnusson/postgresql-audit","description":"Audit trigger for PostgreSQL","fork":true,"url":"https://api.github.com/repos/jmagnusson/postgresql-audit","forks_url":"https://api.github.com/repos/jmagnusson/postgresql-audit/forks","keys_url":"https://api.github.com/repos/jmagnusson/postgresql-audit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jmagnusson/postgresql-audit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jmagnusson/postgresql-audit/teams","hooks_url":"https://api.github.com/repos/jmagnusson/postgresql-audit/hooks","issue_events_url":"https://api.github.com/repos/jmagnusson/postgresql-audit/issues/events{/number}","events_url":"https://api.github.com/repos/jmagnusson/postgresql-audit/events","assignees_url":"https://api.github.com/repos/jmagnusson/postgresql-audit/assignees{/user}","branches_url":"https://api.github.com/repos/jmagnusson/postgresql-audit/branches{/branch}","tags_url":"https://api.github.com/repos/jmagnusson/postgresql-audit/tags","blobs_url":"https://api.github.com/repos/jmagnusson/postgresql-audit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jmagnusson/postgresql-audit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jmagnusson/postgresql-audit/git/refs{/sha}","trees_url":"https://api.github.com/repos/jmagnusson/postgresql-audit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jmagnusson/postgresql-audit/statuses/{sha}","languages_url":"https://api.github.com/repos/jmagnusson/postgresql-audit/languages","stargazers_url":"https://api.github.com/repos/jmagnusson/postgresql-audit/stargazers","contributors_url":"https://api.github.com/repos/jmagnusson/postgresql-audit/contributors","subscribers_url":"https://api.github.com/repos/jmagnusson/postgresql-audit/subscribers","subscription_url":"https://api.github.com/repos/jmagnusson/postgresql-audit/subscription","commits_url":"https://api.github.com/repos/jmagnusson/postgresql-audit/commits{/sha}","git_commits_url":"https://api.github.com/repos/jmagnusson/postgresql-audit/git/commits{/sha}","comments_url":"https://api.github.com/repos/jmagnusson/postgresql-audit/comments{/number}","issue_comment_url":"https://api.github.com/repos/jmagnusson/postgresql-audit/issues/comments{/number}","contents_url":"https://api.github.com/repos/jmagnusson/postgresql-audit/contents/{+path}","compare_url":"https://api.github.com/repos/jmagnusson/postgresql-audit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jmagnusson/postgresql-audit/merges","archive_url":"https://api.github.com/repos/jmagnusson/postgresql-audit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jmagnusson/postgresql-audit/downloads","issues_url":"https://api.github.com/repos/jmagnusson/postgresql-audit/issues{/number}","pulls_url":"https://api.github.com/repos/jmagnusson/postgresql-audit/pulls{/number}","milestones_url":"https://api.github.com/repos/jmagnusson/postgresql-audit/milestones{/number}","notifications_url":"https://api.github.com/repos/jmagnusson/postgresql-audit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jmagnusson/postgresql-audit/labels{/name}","releases_url":"https://api.github.com/repos/jmagnusson/postgresql-audit/releases{/id}","created_at":"2015-10-27T08:20:43Z","updated_at":"2015-10-27T08:20:43Z","pushed_at":"2015-11-09T16:28:22Z","git_url":"git://github.com/jmagnusson/postgresql-audit.git","ssh_url":"git@github.com:jmagnusson/postgresql-audit.git","clone_url":"https://github.com/jmagnusson/postgresql-audit.git","svn_url":"https://github.com/jmagnusson/postgresql-audit","homepage":null,"size":225,"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":"kvesteri:master","ref":"master","sha":"bc6a8532edb84dc33def5c866f74c0af21319edd","user":{"login":"kvesteri","id":398714,"avatar_url":"https://avatars.githubusercontent.com/u/398714?v=3","gravatar_id":"","url":"https://api.github.com/users/kvesteri","html_url":"https://github.com/kvesteri","followers_url":"https://api.github.com/users/kvesteri/followers","following_url":"https://api.github.com/users/kvesteri/following{/other_user}","gists_url":"https://api.github.com/users/kvesteri/gists{/gist_id}","starred_url":"https://api.github.com/users/kvesteri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kvesteri/subscriptions","organizations_url":"https://api.github.com/users/kvesteri/orgs","repos_url":"https://api.github.com/users/kvesteri/repos","events_url":"https://api.github.com/users/kvesteri/events{/privacy}","received_events_url":"https://api.github.com/users/kvesteri/received_events","type":"User","site_admin":false},"repo":{"id":30492941,"name":"postgresql-audit","full_name":"kvesteri/postgresql-audit","owner":{"login":"kvesteri","id":398714,"avatar_url":"https://avatars.githubusercontent.com/u/398714?v=3","gravatar_id":"","url":"https://api.github.com/users/kvesteri","html_url":"https://github.com/kvesteri","followers_url":"https://api.github.com/users/kvesteri/followers","following_url":"https://api.github.com/users/kvesteri/following{/other_user}","gists_url":"https://api.github.com/users/kvesteri/gists{/gist_id}","starred_url":"https://api.github.com/users/kvesteri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kvesteri/subscriptions","organizations_url":"https://api.github.com/users/kvesteri/orgs","repos_url":"https://api.github.com/users/kvesteri/repos","events_url":"https://api.github.com/users/kvesteri/events{/privacy}","received_events_url":"https://api.github.com/users/kvesteri/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kvesteri/postgresql-audit","description":"Audit trigger for PostgreSQL","fork":false,"url":"https://api.github.com/repos/kvesteri/postgresql-audit","forks_url":"https://api.github.com/repos/kvesteri/postgresql-audit/forks","keys_url":"https://api.github.com/repos/kvesteri/postgresql-audit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kvesteri/postgresql-audit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kvesteri/postgresql-audit/teams","hooks_url":"https://api.github.com/repos/kvesteri/postgresql-audit/hooks","issue_events_url":"https://api.github.com/repos/kvesteri/postgresql-audit/issues/events{/number}","events_url":"https://api.github.com/repos/kvesteri/postgresql-audit/events","assignees_url":"https://api.github.com/repos/kvesteri/postgresql-audit/assignees{/user}","branches_url":"https://api.github.com/repos/kvesteri/postgresql-audit/branches{/branch}","tags_url":"https://api.github.com/repos/kvesteri/postgresql-audit/tags","blobs_url":"https://api.github.com/repos/kvesteri/postgresql-audit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kvesteri/postgresql-audit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kvesteri/postgresql-audit/git/refs{/sha}","trees_url":"https://api.github.com/repos/kvesteri/postgresql-audit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kvesteri/postgresql-audit/statuses/{sha}","languages_url":"https://api.github.com/repos/kvesteri/postgresql-audit/languages","stargazers_url":"https://api.github.com/repos/kvesteri/postgresql-audit/stargazers","contributors_url":"https://api.github.com/repos/kvesteri/postgresql-audit/contributors","subscribers_url":"https://api.github.com/repos/kvesteri/postgresql-audit/subscribers","subscription_url":"https://api.github.com/repos/kvesteri/postgresql-audit/subscription","commits_url":"https://api.github.com/repos/kvesteri/postgresql-audit/commits{/sha}","git_commits_url":"https://api.github.com/repos/kvesteri/postgresql-audit/git/commits{/sha}","comments_url":"https://api.github.com/repos/kvesteri/postgresql-audit/comments{/number}","issue_comment_url":"https://api.github.com/repos/kvesteri/postgresql-audit/issues/comments{/number}","contents_url":"https://api.github.com/repos/kvesteri/postgresql-audit/contents/{+path}","compare_url":"https://api.github.com/repos/kvesteri/postgresql-audit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kvesteri/postgresql-audit/merges","archive_url":"https://api.github.com/repos/kvesteri/postgresql-audit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kvesteri/postgresql-audit/downloads","issues_url":"https://api.github.com/repos/kvesteri/postgresql-audit/issues{/number}","pulls_url":"https://api.github.com/repos/kvesteri/postgresql-audit/pulls{/number}","milestones_url":"https://api.github.com/repos/kvesteri/postgresql-audit/milestones{/number}","notifications_url":"https://api.github.com/repos/kvesteri/postgresql-audit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kvesteri/postgresql-audit/labels{/name}","releases_url":"https://api.github.com/repos/kvesteri/postgresql-audit/releases{/id}","created_at":"2015-02-08T14:10:23Z","updated_at":"2015-09-15T10:55:16Z","pushed_at":"2015-11-10T07:28:57Z","git_url":"git://github.com/kvesteri/postgresql-audit.git","ssh_url":"git@github.com:kvesteri/postgresql-audit.git","clone_url":"https://github.com/kvesteri/postgresql-audit.git","svn_url":"https://github.com/kvesteri/postgresql-audit","homepage":null,"size":686,"stargazers_count":11,"watchers_count":11,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":4,"forks":4,"open_issues":4,"watchers":11,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kvesteri/postgresql-audit/pulls/4"},"html":{"href":"https://github.com/kvesteri/postgresql-audit/pull/4"},"issue":{"href":"https://api.github.com/repos/kvesteri/postgresql-audit/issues/4"},"comments":{"href":"https://api.github.com/repos/kvesteri/postgresql-audit/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/kvesteri/postgresql-audit/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/kvesteri/postgresql-audit/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kvesteri/postgresql-audit/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/kvesteri/postgresql-audit/statuses/562aa7b3bdda36190cc7abbb5146b3665c0ecb8b"}}}}