{"action":"created","comment":{"url":"https://api.github.com/repos/dimagi/commcare-hq/pulls/comments/73784514","id":73784514,"diff_hunk":"@@ -0,0 +1,652 @@\n+from collections import namedtuple\n+\n+from django.test import SimpleTestCase, TestCase\n+\n+from corehq.apps.domain.shortcuts import create_domain\n+from corehq.apps.locations.models import Location, LocationType\n+from corehq.apps.locations.tree_utils import TreeError, assert_no_cycles, expansion_validators\n+from corehq.apps.locations.bulk_management import (\n+    NewLocationImporter,\n+    LocationTypeStub,\n+    LocationStub,\n+    LocationTreeValidator,\n+    LocationCollection,\n+)\n+\n+\n+# These example types and trees mirror the information available in the upload files\n+\n+FLAT_LOCATION_TYPES = [\n+    # name, code, parent_code, do_delete, shares_cases, view_descendants, expand_from, sync_to, index\n+    # ('name', 'code', 'parent_code', 'shares_cases', 'view_descendants'),\n+    ('State', 'state', '', False, False, False, '', '', 0),\n+    ('County', 'county', 'state', False, False, True, '', '', 0),\n+    ('City', 'city', 'county', False, True, False, '', '', 0),\n+]\n+\n+DUPLICATE_TYPE_CODES = [\n+    # ('name', 'code', 'parent_code', 'shares_cases', 'view_descendants'),\n+    ('State', 'state', '', False, False, False, '', '', 0),\n+    ('County', 'county', 'state', False, False, True, '', '', 0),\n+    ('City', 'city', 'county', False, True, False, '', '', 0),\n+    ('Other County', 'county', 'state', False, False, True, '', '', 0),\n+]\n+\n+CYCLIC_LOCATION_TYPES = [\n+    ('State', 'state', '', False, False, False, '', '', 0),\n+    ('County', 'county', 'state', False, False, True, '', '', 0),\n+    ('City', 'city', 'county', False, True, False, '', '', 0),\n+    # These three cycle:\n+    ('Region', 'region', 'village', False, False, False, '', '', 0),\n+    ('District', 'district', 'region', False, False, True, '', '', 0),\n+    ('Village', 'village', 'district', False, True, False, '', '', 0),\n+]\n+\n+BASIC_LOCATION_TREE = [\n+    # (name, site_code, location_type, parent_code, location_id,\n+    # do_delete, external_id, latitude, longitude, index)\n+    # ('name', 'site_code', 'location_type', 'parent_code', 'location_id',\n+    # 'external_id', 'latitude', 'longitude'),\n+    ('Massachusetts', 'mass', 'state', '', '1234', False, '', '', '', 0),\n+    ('Suffolk', 'suffolk', 'county', 'mass', '2345', False, '', '', '', 0),\n+    ('Boston', 'boston', 'city', 'suffolk', '2346', False, '', '', '', 0),\n+    ('Middlesex', 'middlesex', 'county', 'mass', '3456', False, '', '', '', 0),\n+    ('Cambridge', 'cambridge', 'city', 'middlesex', '3457', False, '', '', '', 0),\n+    ('Florida', 'florida', 'state', '', '5432', False, '', '', '', 0),\n+    ('Duval', 'duval', 'county', 'florida', '5433', False, '', '', '', 0),\n+    ('Jacksonville', 'jacksonville', 'city', 'duval', '5434', False, '', '', '', 0),\n+]\n+\n+MOVE_SUFFOLK_TO_FLORIDA = [\n+    ('Massachusetts', 'mass', 'state', '', '1234', False, '', '', '', 0),\n+    # this is the only changed line (parent is changed to florida)\n+    ('Suffolk', 'suffolk', 'county', 'florida', '2345', False, '', '', '', 0),\n+    ('Boston', 'boston', 'city', 'suffolk', '2346', False, '', '', '', 0),\n+    ('Middlesex', 'middlesex', 'county', 'mass', '3456', False, '', '', '', 0),\n+    ('Cambridge', 'cambridge', 'city', 'middlesex', '3457', False, '', '', '', 0),\n+    ('Florida', 'florida', 'state', '', '5432', False, '', '', '', 0),\n+    ('Duval', 'duval', 'county', 'florida', '5433', False, '', '', '', 0),\n+    ('Jacksonville', 'jacksonville', 'city', 'duval', '5434', False, '', '', '', 0),\n+]\n+\n+DELETE_SUFFOLK = [\n+    ('Massachusetts', 'mass', 'state', '', '1234', False, '', '', '', 0),\n+    # These next two are marked as 'delete'\n+    ('Suffolk', 'suffolk', 'county', 'mass', '2345', True, '', '', '', 0),\n+    ('Boston', 'boston', 'city', 'suffolk', '2346', True, '', '', '', 0),\n+    ('Middlesex', 'middlesex', 'county', 'mass', '3456', False, '', '', '', 0),\n+    ('Cambridge', 'cambridge', 'city', 'middlesex', '3457', False, '', '', '', 0),\n+    ('Florida', 'florida', 'state', '', '5432', False, '', '', '', 0),\n+    ('Duval', 'duval', 'county', 'florida', '5433', False, '', '', '', 0),\n+    ('Jacksonville', 'jacksonville', 'city', 'duval', '5434', False, '', '', '', 0),\n+]\n+\n+MAKE_SUFFOLK_A_STATE_INVALID = [\n+    ('Massachusetts', 'mass', 'state', '', '1234', False, '', '', '', 0),\n+    # This still lists mass as a parent, which is invalid,\n+    # plus, Boston (a city), can't have a state as a parent\n+    ('Suffolk', 'suffolk', 'state', 'mass', '2345', False, '', '', '', 0),\n+    ('Boston', 'boston', 'city', 'suffolk', '2346', False, '', '', '', 0),\n+    ('Middlesex', 'middlesex', 'county', 'mass', '3456', False, '', '', '', 0),\n+    ('Cambridge', 'cambridge', 'city', 'middlesex', '3457', False, '', '', '', 0),\n+    ('Florida', 'florida', 'state', '', '5432', False, '', '', '', 0),\n+    ('Duval', 'duval', 'county', 'florida', '5433', False, '', '', '', 0),\n+    ('Jacksonville', 'jacksonville', 'city', 'duval', '5434', False, '', '', '', 0),\n+]\n+\n+MAKE_SUFFOLK_A_STATE_VALID = [\n+    ('Massachusetts', 'mass', 'state', '', '1234', False, '', '', '', 0),\n+    ('Suffolk', 'suffolk', 'state', '', '2345', False, '', '', '', 0),\n+    ('Boston', 'boston', 'county', 'suffolk', '2346', False, '', '', '', 0),\n+    ('Middlesex', 'middlesex', 'county', 'mass', '3456', False, '', '', '', 0),\n+    ('Cambridge', 'cambridge', 'city', 'middlesex', '3457', False, '', '', '', 0),\n+    ('Florida', 'florida', 'state', '', '5432', False, '', '', '', 0),\n+    ('Duval', 'duval', 'county', 'florida', '5433', False, '', '', '', 0),\n+    ('Jacksonville', 'jacksonville', 'city', 'duval', '5434', False, '', '', '', 0),\n+]\n+\n+DUPLICATE_SITE_CODES = [\n+    ('Massachusetts', 'mass', 'state', '', '1234', False, '', '', '', 0),\n+    ('Suffolk', 'suffolk', 'county', 'mass', '2345', False, '', '', '', 0),\n+    ('Boston', 'boston', 'city', 'suffolk', '2346', False, '', '', '', 0),\n+    ('Middlesex', 'middlesex', 'county', 'mass', '3456', False, '', '', '', 0),\n+    ('Cambridge', 'cambridge', 'city', 'middlesex', '3457', False, '', '', '', 0),\n+    ('East Cambridge', 'cambridge', 'city', 'middlesex', '3457', False, '', '', '', 0),\n+]\n+\n+SAME_NAME_SAME_PARENT = [\n+    ('Massachusetts', 'mass', 'state', '', '1234', False, '', '', '', 0),\n+    ('Middlesex', 'middlesex', 'county', 'mass', '3456', False, '', '', '', 0),\n+    # These two locations have the same name AND same parent\n+    ('Cambridge', 'cambridge', 'city', 'middlesex', '3457', False, '', '', '', 0),\n+    ('Cambridge', 'cambridge2', 'city', 'middlesex', '3458', False, '', '', '', 0),\n+]\n+\n+\n+class TestTreeUtils(SimpleTestCase):\n+    def test_no_issues(self):\n+        assert_no_cycles([\n+            (\"State\", 'TOP'),\n+            (\"County\", \"State\"),\n+            (\"City\", \"County\"),\n+            (\"Region\", \"State\"),\n+            (\"District\", \"Region\"),\n+        ])\n+\n+    def test_bad_parent_ref(self):\n+        with self.assertRaises(TreeError) as e:\n+            assert_no_cycles([\n+                (\"County\", \"State\"),  # State doesn't exist\n+                (\"City\", \"County\"),\n+                (\"Region\", \"State\"),  # State doesn't exist\n+                (\"District\", \"Region\"),\n+            ])\n+        self.assertItemsEqual(\n+            e.exception.affected_nodes,\n+            [\"County\", \"Region\"]\n+        )\n+\n+    def test_has_cycle(self):\n+        with self.assertRaises(TreeError) as e:\n+            assert_no_cycles([\n+                (\"State\", 'TOP'),\n+                (\"County\", \"State\"),\n+                (\"City\", \"County\"),\n+                # These three cycle:\n+                (\"Region\", \"Village\"),\n+                (\"District\", \"Region\"),\n+                (\"Village\", \"District\"),\n+            ])\n+        self.assertItemsEqual(\n+            e.exception.affected_nodes,\n+            [\"Region\", \"District\", \"Village\"]\n+        )\n+\n+    def test_expansion_validators(self):\n+        from_validator, to_validator = expansion_validators(\n+            [('a', 'TOP'), ('b', 'TOP'), ('c', 'a'), ('d', 'a'), ('e', 'b')]\n+        )\n+        self.assertEqual(from_validator('a'), ['a', 'TOP'])\n+        self.assertEqual(from_validator('b'), ['b', 'TOP'])\n+        self.assertEqual(from_validator('c'), ['c', 'a', 'TOP'])\n+        self.assertEqual(from_validator('d'), ['d', 'a', 'TOP'])\n+        self.assertEqual(from_validator('e'), ['e', 'b', 'TOP'])\n+        self.assertEqual(to_validator('a'), ['a', 'c', 'd'])\n+        self.assertEqual(to_validator('b'), ['b', 'e'])\n+        self.assertEqual(to_validator('c'), ['c'])\n+        self.assertEqual(to_validator('d'), ['d'])\n+        self.assertEqual(to_validator('e'), ['e'])\n+\n+\n+def get_validator(location_types, locations, old_collection=None):\n+    validator = LocationTreeValidator(\n+        [LocationTypeStub(*loc_type) for loc_type in location_types],\n+        [LocationStub(*loc) for loc in locations],\n+        old_collection=old_collection\n+    )\n+    return validator\n+\n+\n+MockCollection = namedtuple('MockCollection', 'types locations locations_by_id locations_by_site_code')\n+\n+\n+def make_collection(types, locations):\n+    types = [LocationTypeStub(*loc_type) for loc_type in types]\n+\n+    locations = [LocationStub(*loc) for loc in locations]\n+\n+    return MockCollection(\n+        types=types,\n+        locations=locations,\n+        locations_by_id={l.location_id: l for l in locations},\n+        locations_by_site_code={l.site_code: l for l in locations}\n+    )\n+\n+\n+class TestTreeValidator(SimpleTestCase):\n+\n+    def test_good_location_set(self):\n+        validator = get_validator(FLAT_LOCATION_TYPES, BASIC_LOCATION_TREE)\n+        self.assertEqual(len(validator.errors), 0)\n+\n+    def test_cyclic_location_types(self):\n+        validator = get_validator(CYCLIC_LOCATION_TYPES, BASIC_LOCATION_TREE)\n+        self.assertEqual(len(validator._validate_types_tree()), 3)\n+\n+    def test_bad_type_change(self):\n+        validator = get_validator(FLAT_LOCATION_TYPES, MAKE_SUFFOLK_A_STATE_INVALID)\n+\n+        all_errors = validator.errors\n+        self.assertEqual(len(all_errors), 2)\n+\n+        tree_errors = validator._validate_location_tree()\n+        self.assertEqual(len(tree_errors), 2)\n+\n+    def test_good_type_change(self):\n+        validator = get_validator(FLAT_LOCATION_TYPES, MAKE_SUFFOLK_A_STATE_VALID)\n+        errors = validator.errors\n+        self.assertEqual(len(errors), 0)\n+\n+    def test_duplicate_type_codes(self):\n+        validator = get_validator(DUPLICATE_TYPE_CODES, BASIC_LOCATION_TREE)\n+        errors = validator.errors\n+        type_errors = validator._check_unique_type_codes()\n+        self.assertEqual(len(errors), 1)\n+        self.assertEqual(len(type_errors), 1)\n+        self.assertIn(\"county\", errors[0])\n+\n+    def test_valid_expansions(self):\n+        validator = get_validator(\n+            [\n+                # name, code, parent_code, do_delete, shares_cases, view_descendants, expand_from, sync_to, index\n+                # empty from, descendant as to\n+                ('A', 'a', '', False, False, False, '', 'd', 0),\n+                # itself as from, descendant as to\n+                ('B', 'b', '', False, False, False, 'b', 'e', 0),\n+                # empty to, parentage as from\n+                ('C', 'c', 'a', False, False, False, 'a', '', 0),\n+                # itself as to, parentage as from\n+                ('D', 'd', 'a', False, False, False, 'a', 'd', 0),\n+                # parentage as from, empty to\n+                ('E', 'e', 'b', False, False, False, 'b', '', 0),\n+            ],\n+            []\n+        )\n+        errors = validator.errors\n+        self.assertEqual(errors, [])\n+\n+    def test_invalid_expansions(self):\n+        validator = get_validator(\n+            [\n+                # name, code, parent_code, do_delete, shares_cases, view_descendants, expand_from, sync_to, index\n+                ('A', 'a', '', False, False, False, '', 'd', 0),\n+                # 'a' is not a descendant of 'b'\n+                ('B', 'b', '', False, False, False, 'b', 'a', 0),\n+                ('C', 'c', 'a', False, False, False, 'a', '', 0),\n+                # 'b' doesn't occur in its parentage\n+                ('D', 'd', 'a', False, False, False, 'b', 'd', 0),\n+                ('E', 'e', 'b', False, False, False, 'b', '', 0),\n+            ],\n+            []\n+        )\n+        errors = validator.errors\n+        self.assertEqual(len(errors), 2)\n+\n+    def test_duplicate_location(self):\n+        validator = get_validator(FLAT_LOCATION_TYPES, DUPLICATE_SITE_CODES)\n+        errors = validator.errors\n+        self.assertEqual(len(errors), 2)\n+        self.assertEqual(len(validator._check_unique_location_codes()), 1)\n+        self.assertEqual(len(validator._check_unique_location_ids()), 1)\n+        self.assertIn(\"cambridge\", errors[0])\n+\n+    def test_same_name_same_parent(self):\n+        validator = get_validator(FLAT_LOCATION_TYPES, SAME_NAME_SAME_PARENT)\n+        errors = validator.errors\n+        self.assertEqual(len(errors), 1)\n+        self.assertEqual(len(validator._check_location_names()), 1)\n+        self.assertIn(\"middlesex\", errors[0])\n+\n+    def test_missing_types(self):\n+        # all types in the domain should be listed in given excel\n+        old_types = FLAT_LOCATION_TYPES + [('Galaxy', 'galaxy', '', False, False, False, '', '', 0)]\n+\n+        old_collection = make_collection(old_types, BASIC_LOCATION_TREE)\n+        validator = get_validator(FLAT_LOCATION_TYPES, BASIC_LOCATION_TREE, old_collection)\n+\n+        missing_type_errors = validator._check_unlisted_type_codes()\n+        self.assertEqual(len(missing_type_errors), 1)\n+        self.assertEqual(len(validator.errors), 1)\n+        self.assertIn('galaxy', missing_type_errors[0])\n+\n+    def test_missing_location_ids(self):\n+        # all locations in the domain should be listed in given excel\n+        old_locations = (\n+            BASIC_LOCATION_TREE +\n+            [('extra_state', 'ex_code', 'state', '', 'ex_id', False, '', '', '', 0)]\n+        )\n+        old_collection = make_collection(FLAT_LOCATION_TYPES, old_locations)\n+        validator = get_validator(FLAT_LOCATION_TYPES, BASIC_LOCATION_TREE, old_collection)\n+        missing_locations = validator._check_unlisted_location_ids()\n+        self.assertEqual(len(missing_locations), 1)\n+        self.assertEqual(len(validator.errors), 1)\n+        self.assertIn('extra_state', missing_locations[0])\n+\n+    def test_unknown_location_ids(self):\n+        # all locations in the domain should be listed in given excel\n+\n+        old_collection = make_collection(FLAT_LOCATION_TYPES, BASIC_LOCATION_TREE)\n+        new_locations = (\n+            BASIC_LOCATION_TREE +\n+            [('extra_state', 'ex_code', 'state', '', 'ex_id', False, '', '', '', 0)]\n+        )\n+        validator = get_validator(FLAT_LOCATION_TYPES, new_locations, old_collection)\n+        unknown_locations = validator._check_unknown_location_ids()\n+        self.assertEqual(len(unknown_locations), 1)\n+        self.assertEqual(len(validator.errors), 1)\n+        self.assertIn('ex_id', unknown_locations[0])\n+\n+\n+class TestBulkManagement(TestCase):","path":"corehq/apps/locations/tests/test_bulk_management.py","position":330,"original_position":330,"commit_id":"ea8514ecba91d8875853478a2fcdd6ab59667eb6","original_commit_id":"ea8514ecba91d8875853478a2fcdd6ab59667eb6","user":{"login":"sravfeyn","id":829142,"avatar_url":"https://avatars.githubusercontent.com/u/829142?v=3","gravatar_id":"","url":"https://api.github.com/users/sravfeyn","html_url":"https://github.com/sravfeyn","followers_url":"https://api.github.com/users/sravfeyn/followers","following_url":"https://api.github.com/users/sravfeyn/following{/other_user}","gists_url":"https://api.github.com/users/sravfeyn/gists{/gist_id}","starred_url":"https://api.github.com/users/sravfeyn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sravfeyn/subscriptions","organizations_url":"https://api.github.com/users/sravfeyn/orgs","repos_url":"https://api.github.com/users/sravfeyn/repos","events_url":"https://api.github.com/users/sravfeyn/events{/privacy}","received_events_url":"https://api.github.com/users/sravfeyn/received_events","type":"User","site_admin":false},"body":"@esoergel What do you think of overall test coverage, do you think anything more is needed?","created_at":"2016-08-06T10:53:02Z","updated_at":"2016-08-06T10:53:02Z","html_url":"https://github.com/dimagi/commcare-hq/pull/12199#discussion_r73784514","pull_request_url":"https://api.github.com/repos/dimagi/commcare-hq/pulls/12199","_links":{"self":{"href":"https://api.github.com/repos/dimagi/commcare-hq/pulls/comments/73784514"},"html":{"href":"https://github.com/dimagi/commcare-hq/pull/12199#discussion_r73784514"},"pull_request":{"href":"https://api.github.com/repos/dimagi/commcare-hq/pulls/12199"}}},"pull_request":{"url":"https://api.github.com/repos/dimagi/commcare-hq/pulls/12199","id":74826529,"html_url":"https://github.com/dimagi/commcare-hq/pull/12199","diff_url":"https://github.com/dimagi/commcare-hq/pull/12199.diff","patch_url":"https://github.com/dimagi/commcare-hq/pull/12199.patch","issue_url":"https://api.github.com/repos/dimagi/commcare-hq/issues/12199","number":12199,"state":"open","locked":false,"title":"Add bulk organization management test skeleton","user":{"login":"esoergel","id":2367539,"avatar_url":"https://avatars.githubusercontent.com/u/2367539?v=3","gravatar_id":"","url":"https://api.github.com/users/esoergel","html_url":"https://github.com/esoergel","followers_url":"https://api.github.com/users/esoergel/followers","following_url":"https://api.github.com/users/esoergel/following{/other_user}","gists_url":"https://api.github.com/users/esoergel/gists{/gist_id}","starred_url":"https://api.github.com/users/esoergel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/esoergel/subscriptions","organizations_url":"https://api.github.com/users/esoergel/orgs","repos_url":"https://api.github.com/users/esoergel/repos","events_url":"https://api.github.com/users/esoergel/events{/privacy}","received_events_url":"https://api.github.com/users/esoergel/received_events","type":"User","site_admin":false},"body":"@sravfeyn @sheelio\nThis is a mock-up of the tests we spoke about, Sravan.  Feel free to use and modify or discard as you see fit.","created_at":"2016-06-22T17:42:48Z","updated_at":"2016-08-06T10:53:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"38f83b845bd55e50c93dbd990f412d8f83aefc39","assignee":{"login":"sravfeyn","id":829142,"avatar_url":"https://avatars.githubusercontent.com/u/829142?v=3","gravatar_id":"","url":"https://api.github.com/users/sravfeyn","html_url":"https://github.com/sravfeyn","followers_url":"https://api.github.com/users/sravfeyn/followers","following_url":"https://api.github.com/users/sravfeyn/following{/other_user}","gists_url":"https://api.github.com/users/sravfeyn/gists{/gist_id}","starred_url":"https://api.github.com/users/sravfeyn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sravfeyn/subscriptions","organizations_url":"https://api.github.com/users/sravfeyn/orgs","repos_url":"https://api.github.com/users/sravfeyn/repos","events_url":"https://api.github.com/users/sravfeyn/events{/privacy}","received_events_url":"https://api.github.com/users/sravfeyn/received_events","type":"User","site_admin":false},"assignees":[{"login":"sravfeyn","id":829142,"avatar_url":"https://avatars.githubusercontent.com/u/829142?v=3","gravatar_id":"","url":"https://api.github.com/users/sravfeyn","html_url":"https://github.com/sravfeyn","followers_url":"https://api.github.com/users/sravfeyn/followers","following_url":"https://api.github.com/users/sravfeyn/following{/other_user}","gists_url":"https://api.github.com/users/sravfeyn/gists{/gist_id}","starred_url":"https://api.github.com/users/sravfeyn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sravfeyn/subscriptions","organizations_url":"https://api.github.com/users/sravfeyn/orgs","repos_url":"https://api.github.com/users/sravfeyn/repos","events_url":"https://api.github.com/users/sravfeyn/events{/privacy}","received_events_url":"https://api.github.com/users/sravfeyn/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/dimagi/commcare-hq/pulls/12199/commits","review_comments_url":"https://api.github.com/repos/dimagi/commcare-hq/pulls/12199/comments","review_comment_url":"https://api.github.com/repos/dimagi/commcare-hq/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dimagi/commcare-hq/issues/12199/comments","statuses_url":"https://api.github.com/repos/dimagi/commcare-hq/statuses/ea8514ecba91d8875853478a2fcdd6ab59667eb6","head":{"label":"dimagi:loc-tests","ref":"loc-tests","sha":"ea8514ecba91d8875853478a2fcdd6ab59667eb6","user":{"login":"dimagi","id":94514,"avatar_url":"https://avatars.githubusercontent.com/u/94514?v=3","gravatar_id":"","url":"https://api.github.com/users/dimagi","html_url":"https://github.com/dimagi","followers_url":"https://api.github.com/users/dimagi/followers","following_url":"https://api.github.com/users/dimagi/following{/other_user}","gists_url":"https://api.github.com/users/dimagi/gists{/gist_id}","starred_url":"https://api.github.com/users/dimagi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimagi/subscriptions","organizations_url":"https://api.github.com/users/dimagi/orgs","repos_url":"https://api.github.com/users/dimagi/repos","events_url":"https://api.github.com/users/dimagi/events{/privacy}","received_events_url":"https://api.github.com/users/dimagi/received_events","type":"Organization","site_admin":false},"repo":{"id":247278,"name":"commcare-hq","full_name":"dimagi/commcare-hq","owner":{"login":"dimagi","id":94514,"avatar_url":"https://avatars.githubusercontent.com/u/94514?v=3","gravatar_id":"","url":"https://api.github.com/users/dimagi","html_url":"https://github.com/dimagi","followers_url":"https://api.github.com/users/dimagi/followers","following_url":"https://api.github.com/users/dimagi/following{/other_user}","gists_url":"https://api.github.com/users/dimagi/gists{/gist_id}","starred_url":"https://api.github.com/users/dimagi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimagi/subscriptions","organizations_url":"https://api.github.com/users/dimagi/orgs","repos_url":"https://api.github.com/users/dimagi/repos","events_url":"https://api.github.com/users/dimagi/events{/privacy}","received_events_url":"https://api.github.com/users/dimagi/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dimagi/commcare-hq","description":"A server-side tool to help manage community health workers, written in Django","fork":false,"url":"https://api.github.com/repos/dimagi/commcare-hq","forks_url":"https://api.github.com/repos/dimagi/commcare-hq/forks","keys_url":"https://api.github.com/repos/dimagi/commcare-hq/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dimagi/commcare-hq/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dimagi/commcare-hq/teams","hooks_url":"https://api.github.com/repos/dimagi/commcare-hq/hooks","issue_events_url":"https://api.github.com/repos/dimagi/commcare-hq/issues/events{/number}","events_url":"https://api.github.com/repos/dimagi/commcare-hq/events","assignees_url":"https://api.github.com/repos/dimagi/commcare-hq/assignees{/user}","branches_url":"https://api.github.com/repos/dimagi/commcare-hq/branches{/branch}","tags_url":"https://api.github.com/repos/dimagi/commcare-hq/tags","blobs_url":"https://api.github.com/repos/dimagi/commcare-hq/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dimagi/commcare-hq/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dimagi/commcare-hq/git/refs{/sha}","trees_url":"https://api.github.com/repos/dimagi/commcare-hq/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dimagi/commcare-hq/statuses/{sha}","languages_url":"https://api.github.com/repos/dimagi/commcare-hq/languages","stargazers_url":"https://api.github.com/repos/dimagi/commcare-hq/stargazers","contributors_url":"https://api.github.com/repos/dimagi/commcare-hq/contributors","subscribers_url":"https://api.github.com/repos/dimagi/commcare-hq/subscribers","subscription_url":"https://api.github.com/repos/dimagi/commcare-hq/subscription","commits_url":"https://api.github.com/repos/dimagi/commcare-hq/commits{/sha}","git_commits_url":"https://api.github.com/repos/dimagi/commcare-hq/git/commits{/sha}","comments_url":"https://api.github.com/repos/dimagi/commcare-hq/comments{/number}","issue_comment_url":"https://api.github.com/repos/dimagi/commcare-hq/issues/comments{/number}","contents_url":"https://api.github.com/repos/dimagi/commcare-hq/contents/{+path}","compare_url":"https://api.github.com/repos/dimagi/commcare-hq/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dimagi/commcare-hq/merges","archive_url":"https://api.github.com/repos/dimagi/commcare-hq/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dimagi/commcare-hq/downloads","issues_url":"https://api.github.com/repos/dimagi/commcare-hq/issues{/number}","pulls_url":"https://api.github.com/repos/dimagi/commcare-hq/pulls{/number}","milestones_url":"https://api.github.com/repos/dimagi/commcare-hq/milestones{/number}","notifications_url":"https://api.github.com/repos/dimagi/commcare-hq/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dimagi/commcare-hq/labels{/name}","releases_url":"https://api.github.com/repos/dimagi/commcare-hq/releases{/id}","deployments_url":"https://api.github.com/repos/dimagi/commcare-hq/deployments","created_at":"2009-07-09T17:00:07Z","updated_at":"2016-05-16T15:23:03Z","pushed_at":"2016-08-06T09:16:48Z","git_url":"git://github.com/dimagi/commcare-hq.git","ssh_url":"git@github.com:dimagi/commcare-hq.git","clone_url":"https://github.com/dimagi/commcare-hq.git","svn_url":"https://github.com/dimagi/commcare-hq","homepage":"http://www.commcarehq.org","size":316296,"stargazers_count":72,"watchers_count":72,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":70,"mirror_url":null,"open_issues_count":48,"forks":70,"open_issues":48,"watchers":72,"default_branch":"master"}},"base":{"label":"dimagi:master","ref":"master","sha":"fb57400f242b2227d46751e73397fff294b4674b","user":{"login":"dimagi","id":94514,"avatar_url":"https://avatars.githubusercontent.com/u/94514?v=3","gravatar_id":"","url":"https://api.github.com/users/dimagi","html_url":"https://github.com/dimagi","followers_url":"https://api.github.com/users/dimagi/followers","following_url":"https://api.github.com/users/dimagi/following{/other_user}","gists_url":"https://api.github.com/users/dimagi/gists{/gist_id}","starred_url":"https://api.github.com/users/dimagi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimagi/subscriptions","organizations_url":"https://api.github.com/users/dimagi/orgs","repos_url":"https://api.github.com/users/dimagi/repos","events_url":"https://api.github.com/users/dimagi/events{/privacy}","received_events_url":"https://api.github.com/users/dimagi/received_events","type":"Organization","site_admin":false},"repo":{"id":247278,"name":"commcare-hq","full_name":"dimagi/commcare-hq","owner":{"login":"dimagi","id":94514,"avatar_url":"https://avatars.githubusercontent.com/u/94514?v=3","gravatar_id":"","url":"https://api.github.com/users/dimagi","html_url":"https://github.com/dimagi","followers_url":"https://api.github.com/users/dimagi/followers","following_url":"https://api.github.com/users/dimagi/following{/other_user}","gists_url":"https://api.github.com/users/dimagi/gists{/gist_id}","starred_url":"https://api.github.com/users/dimagi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimagi/subscriptions","organizations_url":"https://api.github.com/users/dimagi/orgs","repos_url":"https://api.github.com/users/dimagi/repos","events_url":"https://api.github.com/users/dimagi/events{/privacy}","received_events_url":"https://api.github.com/users/dimagi/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dimagi/commcare-hq","description":"A server-side tool to help manage community health workers, written in Django","fork":false,"url":"https://api.github.com/repos/dimagi/commcare-hq","forks_url":"https://api.github.com/repos/dimagi/commcare-hq/forks","keys_url":"https://api.github.com/repos/dimagi/commcare-hq/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dimagi/commcare-hq/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dimagi/commcare-hq/teams","hooks_url":"https://api.github.com/repos/dimagi/commcare-hq/hooks","issue_events_url":"https://api.github.com/repos/dimagi/commcare-hq/issues/events{/number}","events_url":"https://api.github.com/repos/dimagi/commcare-hq/events","assignees_url":"https://api.github.com/repos/dimagi/commcare-hq/assignees{/user}","branches_url":"https://api.github.com/repos/dimagi/commcare-hq/branches{/branch}","tags_url":"https://api.github.com/repos/dimagi/commcare-hq/tags","blobs_url":"https://api.github.com/repos/dimagi/commcare-hq/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dimagi/commcare-hq/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dimagi/commcare-hq/git/refs{/sha}","trees_url":"https://api.github.com/repos/dimagi/commcare-hq/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dimagi/commcare-hq/statuses/{sha}","languages_url":"https://api.github.com/repos/dimagi/commcare-hq/languages","stargazers_url":"https://api.github.com/repos/dimagi/commcare-hq/stargazers","contributors_url":"https://api.github.com/repos/dimagi/commcare-hq/contributors","subscribers_url":"https://api.github.com/repos/dimagi/commcare-hq/subscribers","subscription_url":"https://api.github.com/repos/dimagi/commcare-hq/subscription","commits_url":"https://api.github.com/repos/dimagi/commcare-hq/commits{/sha}","git_commits_url":"https://api.github.com/repos/dimagi/commcare-hq/git/commits{/sha}","comments_url":"https://api.github.com/repos/dimagi/commcare-hq/comments{/number}","issue_comment_url":"https://api.github.com/repos/dimagi/commcare-hq/issues/comments{/number}","contents_url":"https://api.github.com/repos/dimagi/commcare-hq/contents/{+path}","compare_url":"https://api.github.com/repos/dimagi/commcare-hq/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dimagi/commcare-hq/merges","archive_url":"https://api.github.com/repos/dimagi/commcare-hq/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dimagi/commcare-hq/downloads","issues_url":"https://api.github.com/repos/dimagi/commcare-hq/issues{/number}","pulls_url":"https://api.github.com/repos/dimagi/commcare-hq/pulls{/number}","milestones_url":"https://api.github.com/repos/dimagi/commcare-hq/milestones{/number}","notifications_url":"https://api.github.com/repos/dimagi/commcare-hq/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dimagi/commcare-hq/labels{/name}","releases_url":"https://api.github.com/repos/dimagi/commcare-hq/releases{/id}","deployments_url":"https://api.github.com/repos/dimagi/commcare-hq/deployments","created_at":"2009-07-09T17:00:07Z","updated_at":"2016-05-16T15:23:03Z","pushed_at":"2016-08-06T09:16:48Z","git_url":"git://github.com/dimagi/commcare-hq.git","ssh_url":"git@github.com:dimagi/commcare-hq.git","clone_url":"https://github.com/dimagi/commcare-hq.git","svn_url":"https://github.com/dimagi/commcare-hq","homepage":"http://www.commcarehq.org","size":316296,"stargazers_count":72,"watchers_count":72,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":70,"mirror_url":null,"open_issues_count":48,"forks":70,"open_issues":48,"watchers":72,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dimagi/commcare-hq/pulls/12199"},"html":{"href":"https://github.com/dimagi/commcare-hq/pull/12199"},"issue":{"href":"https://api.github.com/repos/dimagi/commcare-hq/issues/12199"},"comments":{"href":"https://api.github.com/repos/dimagi/commcare-hq/issues/12199/comments"},"review_comments":{"href":"https://api.github.com/repos/dimagi/commcare-hq/pulls/12199/comments"},"review_comment":{"href":"https://api.github.com/repos/dimagi/commcare-hq/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dimagi/commcare-hq/pulls/12199/commits"},"statuses":{"href":"https://api.github.com/repos/dimagi/commcare-hq/statuses/ea8514ecba91d8875853478a2fcdd6ab59667eb6"}}}}
{"actor":{"display_login":"sravfeyn"}}