{"action":"created","comment":{"url":"https://api.github.com/repos/django/django/pulls/comments/94175221","pull_request_review_id":14705896,"id":94175221,"diff_hunk":"@@ -198,3 +198,31 @@ def test_exclude_tags(self):\n         self.assertEqual(runner.build_suite(['test_discovery_sample.tests_sample']).countTestCases(), 0)\n         runner = DiscoverRunner(exclude_tags=['slow'])\n         self.assertEqual(runner.build_suite(['test_discovery_sample.tests_sample']).countTestCases(), 4)\n+\n+    def test_transaction_test_case_before_simple_test_case(self):\n+        runner = DiscoverRunner()\n+        suite = runner.build_suite(['test_discovery_sample3.tests_transaction_test_case_ordering'])\n+        suite = tuple(suite)\n+\n+        # TransactionTestCase should be second, just after TestCase\n+        self.assertIn('TestTransactionTestCase', suite[1].id())\n+\n+    def test_transaction_test_case_next_serialized_rollback_option(self):\n+        runner = DiscoverRunner()\n+        suite = runner.build_suite(['test_discovery_sample3.tests_transaction_test_case_mixed'])\n+        suite = tuple(suite)\n+\n+        first_transaction_test_case = suite[1]","path":"tests/test_runner/test_discover_runner.py","position":18,"original_position":18,"commit_id":"7683205f8758e4dc704c383c0fdbf2b80f16b63c","original_commit_id":"7683205f8758e4dc704c383c0fdbf2b80f16b63c","user":{"login":"timgraham","id":411869,"avatar_url":"https://avatars.githubusercontent.com/u/411869?v=3","gravatar_id":"","url":"https://api.github.com/users/timgraham","html_url":"https://github.com/timgraham","followers_url":"https://api.github.com/users/timgraham/followers","following_url":"https://api.github.com/users/timgraham/following{/other_user}","gists_url":"https://api.github.com/users/timgraham/gists{/gist_id}","starred_url":"https://api.github.com/users/timgraham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timgraham/subscriptions","organizations_url":"https://api.github.com/users/timgraham/orgs","repos_url":"https://api.github.com/users/timgraham/repos","events_url":"https://api.github.com/users/timgraham/events{/privacy}","received_events_url":"https://api.github.com/users/timgraham/received_events","type":"User","site_admin":false},"body":"use tuple unpacking rather than indexing?","created_at":"2016-12-29T20:08:47Z","updated_at":"2016-12-29T20:12:59Z","html_url":"https://github.com/django/django/pull/7528#discussion_r94175221","pull_request_url":"https://api.github.com/repos/django/django/pulls/7528","_links":{"self":{"href":"https://api.github.com/repos/django/django/pulls/comments/94175221"},"html":{"href":"https://github.com/django/django/pull/7528#discussion_r94175221"},"pull_request":{"href":"https://api.github.com/repos/django/django/pulls/7528"}}},"pull_request":{"url":"https://api.github.com/repos/django/django/pulls/7528","id":92681003,"html_url":"https://github.com/django/django/pull/7528","diff_url":"https://github.com/django/django/pull/7528.diff","patch_url":"https://github.com/django/django/pull/7528.patch","issue_url":"https://api.github.com/repos/django/django/issues/7528","number":7528,"state":"open","locked":false,"title":" Fixed #25251 -- Initial data migration lost after TransactionTestCase (3)","user":{"login":"romgar","id":2834704,"avatar_url":"https://avatars.githubusercontent.com/u/2834704?v=3","gravatar_id":"","url":"https://api.github.com/users/romgar","html_url":"https://github.com/romgar","followers_url":"https://api.github.com/users/romgar/followers","following_url":"https://api.github.com/users/romgar/following{/other_user}","gists_url":"https://api.github.com/users/romgar/gists{/gist_id}","starred_url":"https://api.github.com/users/romgar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/romgar/subscriptions","organizations_url":"https://api.github.com/users/romgar/orgs","repos_url":"https://api.github.com/users/romgar/repos","events_url":"https://api.github.com/users/romgar/events{/privacy}","received_events_url":"https://api.github.com/users/romgar/received_events","type":"User","site_admin":false},"body":"Data loaded in migrations are restored at the beginning of each `TransactionTestCase` and all the tables are truncated at the end of these test cases.\r\nIt means that, at the end of your whole test suite, if there was at least one `TransactionTestCase`, the migrated data are no more in the database, specially surprising when using `--keepdb` option.\r\nNow we restore data at the end of a `TransactionTestCase`, to be sure that the next test will be in the expected environment (data loaded from initial migrations)\r\nIt also means that we add some informations in the test class itself to know if the next test needs a data rollback, to handle situations where `TransactionTestCase` with `serialized_rollback = True` and `serialized_callback = False` are mixed.\r\n\r\n@timgraham At the end I preferred to create a new PR to come back to a fresh environment for further discussions. Initial proposals were https://github.com/django/django/pull/6137 and https://github.com/django/django/pull/6297.\r\n","created_at":"2016-11-07T22:48:46Z","updated_at":"2016-12-29T20:12:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dae956e89ea69f7b6b02f5f34bf3daf092baff92","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/django/django/pulls/7528/commits","review_comments_url":"https://api.github.com/repos/django/django/pulls/7528/comments","review_comment_url":"https://api.github.com/repos/django/django/pulls/comments{/number}","comments_url":"https://api.github.com/repos/django/django/issues/7528/comments","statuses_url":"https://api.github.com/repos/django/django/statuses/7683205f8758e4dc704c383c0fdbf2b80f16b63c","head":{"label":"romgar:ticket_25251_3","ref":"ticket_25251_3","sha":"7683205f8758e4dc704c383c0fdbf2b80f16b63c","user":{"login":"romgar","id":2834704,"avatar_url":"https://avatars.githubusercontent.com/u/2834704?v=3","gravatar_id":"","url":"https://api.github.com/users/romgar","html_url":"https://github.com/romgar","followers_url":"https://api.github.com/users/romgar/followers","following_url":"https://api.github.com/users/romgar/following{/other_user}","gists_url":"https://api.github.com/users/romgar/gists{/gist_id}","starred_url":"https://api.github.com/users/romgar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/romgar/subscriptions","organizations_url":"https://api.github.com/users/romgar/orgs","repos_url":"https://api.github.com/users/romgar/repos","events_url":"https://api.github.com/users/romgar/events{/privacy}","received_events_url":"https://api.github.com/users/romgar/received_events","type":"User","site_admin":false},"repo":{"id":45731483,"name":"django","full_name":"romgar/django","owner":{"login":"romgar","id":2834704,"avatar_url":"https://avatars.githubusercontent.com/u/2834704?v=3","gravatar_id":"","url":"https://api.github.com/users/romgar","html_url":"https://github.com/romgar","followers_url":"https://api.github.com/users/romgar/followers","following_url":"https://api.github.com/users/romgar/following{/other_user}","gists_url":"https://api.github.com/users/romgar/gists{/gist_id}","starred_url":"https://api.github.com/users/romgar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/romgar/subscriptions","organizations_url":"https://api.github.com/users/romgar/orgs","repos_url":"https://api.github.com/users/romgar/repos","events_url":"https://api.github.com/users/romgar/events{/privacy}","received_events_url":"https://api.github.com/users/romgar/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/romgar/django","description":"The Web framework for perfectionists with deadlines.","fork":true,"url":"https://api.github.com/repos/romgar/django","forks_url":"https://api.github.com/repos/romgar/django/forks","keys_url":"https://api.github.com/repos/romgar/django/keys{/key_id}","collaborators_url":"https://api.github.com/repos/romgar/django/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/romgar/django/teams","hooks_url":"https://api.github.com/repos/romgar/django/hooks","issue_events_url":"https://api.github.com/repos/romgar/django/issues/events{/number}","events_url":"https://api.github.com/repos/romgar/django/events","assignees_url":"https://api.github.com/repos/romgar/django/assignees{/user}","branches_url":"https://api.github.com/repos/romgar/django/branches{/branch}","tags_url":"https://api.github.com/repos/romgar/django/tags","blobs_url":"https://api.github.com/repos/romgar/django/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/romgar/django/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/romgar/django/git/refs{/sha}","trees_url":"https://api.github.com/repos/romgar/django/git/trees{/sha}","statuses_url":"https://api.github.com/repos/romgar/django/statuses/{sha}","languages_url":"https://api.github.com/repos/romgar/django/languages","stargazers_url":"https://api.github.com/repos/romgar/django/stargazers","contributors_url":"https://api.github.com/repos/romgar/django/contributors","subscribers_url":"https://api.github.com/repos/romgar/django/subscribers","subscription_url":"https://api.github.com/repos/romgar/django/subscription","commits_url":"https://api.github.com/repos/romgar/django/commits{/sha}","git_commits_url":"https://api.github.com/repos/romgar/django/git/commits{/sha}","comments_url":"https://api.github.com/repos/romgar/django/comments{/number}","issue_comment_url":"https://api.github.com/repos/romgar/django/issues/comments{/number}","contents_url":"https://api.github.com/repos/romgar/django/contents/{+path}","compare_url":"https://api.github.com/repos/romgar/django/compare/{base}...{head}","merges_url":"https://api.github.com/repos/romgar/django/merges","archive_url":"https://api.github.com/repos/romgar/django/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/romgar/django/downloads","issues_url":"https://api.github.com/repos/romgar/django/issues{/number}","pulls_url":"https://api.github.com/repos/romgar/django/pulls{/number}","milestones_url":"https://api.github.com/repos/romgar/django/milestones{/number}","notifications_url":"https://api.github.com/repos/romgar/django/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/romgar/django/labels{/name}","releases_url":"https://api.github.com/repos/romgar/django/releases{/id}","deployments_url":"https://api.github.com/repos/romgar/django/deployments","created_at":"2015-11-07T10:10:32Z","updated_at":"2016-02-11T16:56:46Z","pushed_at":"2016-12-23T10:43:44Z","git_url":"git://github.com/romgar/django.git","ssh_url":"git@github.com:romgar/django.git","clone_url":"https://github.com/romgar/django.git","svn_url":"https://github.com/romgar/django","homepage":"https://www.djangoproject.com/","size":151842,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"django:master","ref":"master","sha":"7b05ffd95d2ab8c6653ce4efc49658efb79965c8","user":{"login":"django","id":27804,"avatar_url":"https://avatars.githubusercontent.com/u/27804?v=3","gravatar_id":"","url":"https://api.github.com/users/django","html_url":"https://github.com/django","followers_url":"https://api.github.com/users/django/followers","following_url":"https://api.github.com/users/django/following{/other_user}","gists_url":"https://api.github.com/users/django/gists{/gist_id}","starred_url":"https://api.github.com/users/django/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/django/subscriptions","organizations_url":"https://api.github.com/users/django/orgs","repos_url":"https://api.github.com/users/django/repos","events_url":"https://api.github.com/users/django/events{/privacy}","received_events_url":"https://api.github.com/users/django/received_events","type":"Organization","site_admin":false},"repo":{"id":4164482,"name":"django","full_name":"django/django","owner":{"login":"django","id":27804,"avatar_url":"https://avatars.githubusercontent.com/u/27804?v=3","gravatar_id":"","url":"https://api.github.com/users/django","html_url":"https://github.com/django","followers_url":"https://api.github.com/users/django/followers","following_url":"https://api.github.com/users/django/following{/other_user}","gists_url":"https://api.github.com/users/django/gists{/gist_id}","starred_url":"https://api.github.com/users/django/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/django/subscriptions","organizations_url":"https://api.github.com/users/django/orgs","repos_url":"https://api.github.com/users/django/repos","events_url":"https://api.github.com/users/django/events{/privacy}","received_events_url":"https://api.github.com/users/django/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/django/django","description":"The Web framework for perfectionists with deadlines.","fork":false,"url":"https://api.github.com/repos/django/django","forks_url":"https://api.github.com/repos/django/django/forks","keys_url":"https://api.github.com/repos/django/django/keys{/key_id}","collaborators_url":"https://api.github.com/repos/django/django/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/django/django/teams","hooks_url":"https://api.github.com/repos/django/django/hooks","issue_events_url":"https://api.github.com/repos/django/django/issues/events{/number}","events_url":"https://api.github.com/repos/django/django/events","assignees_url":"https://api.github.com/repos/django/django/assignees{/user}","branches_url":"https://api.github.com/repos/django/django/branches{/branch}","tags_url":"https://api.github.com/repos/django/django/tags","blobs_url":"https://api.github.com/repos/django/django/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/django/django/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/django/django/git/refs{/sha}","trees_url":"https://api.github.com/repos/django/django/git/trees{/sha}","statuses_url":"https://api.github.com/repos/django/django/statuses/{sha}","languages_url":"https://api.github.com/repos/django/django/languages","stargazers_url":"https://api.github.com/repos/django/django/stargazers","contributors_url":"https://api.github.com/repos/django/django/contributors","subscribers_url":"https://api.github.com/repos/django/django/subscribers","subscription_url":"https://api.github.com/repos/django/django/subscription","commits_url":"https://api.github.com/repos/django/django/commits{/sha}","git_commits_url":"https://api.github.com/repos/django/django/git/commits{/sha}","comments_url":"https://api.github.com/repos/django/django/comments{/number}","issue_comment_url":"https://api.github.com/repos/django/django/issues/comments{/number}","contents_url":"https://api.github.com/repos/django/django/contents/{+path}","compare_url":"https://api.github.com/repos/django/django/compare/{base}...{head}","merges_url":"https://api.github.com/repos/django/django/merges","archive_url":"https://api.github.com/repos/django/django/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/django/django/downloads","issues_url":"https://api.github.com/repos/django/django/issues{/number}","pulls_url":"https://api.github.com/repos/django/django/pulls{/number}","milestones_url":"https://api.github.com/repos/django/django/milestones{/number}","notifications_url":"https://api.github.com/repos/django/django/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/django/django/labels{/name}","releases_url":"https://api.github.com/repos/django/django/releases{/id}","deployments_url":"https://api.github.com/repos/django/django/deployments","created_at":"2012-04-28T02:47:18Z","updated_at":"2016-12-29T19:37:24Z","pushed_at":"2016-12-29T19:32:15Z","git_url":"git://github.com/django/django.git","ssh_url":"git@github.com:django/django.git","clone_url":"https://github.com/django/django.git","svn_url":"https://github.com/django/django","homepage":"https://www.djangoproject.com/","size":155589,"stargazers_count":22845,"watchers_count":22845,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":9230,"mirror_url":null,"open_issues_count":97,"forks":9230,"open_issues":97,"watchers":22845,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/django/django/pulls/7528"},"html":{"href":"https://github.com/django/django/pull/7528"},"issue":{"href":"https://api.github.com/repos/django/django/issues/7528"},"comments":{"href":"https://api.github.com/repos/django/django/issues/7528/comments"},"review_comments":{"href":"https://api.github.com/repos/django/django/pulls/7528/comments"},"review_comment":{"href":"https://api.github.com/repos/django/django/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/django/django/pulls/7528/commits"},"statuses":{"href":"https://api.github.com/repos/django/django/statuses/7683205f8758e4dc704c383c0fdbf2b80f16b63c"}}}}
{"actor":{"display_login":"timgraham"}}