diff --git a/openlobby/core/api/types.py b/openlobby/core/api/types.py index 2e6432daa1f810c3d5ca0e378c433b2ba49eb574..50073c569a825bd21f3903a5ae4615041f3ef63f 100644 --- a/openlobby/core/api/types.py +++ b/openlobby/core/api/types.py @@ -87,6 +87,7 @@ class User(graphene.ObjectType): openid_uid = graphene.String() first_name = graphene.String() last_name = graphene.String() + name_collision_id = graphene.Int() email = graphene.String() is_author = graphene.Boolean() extra = JSONString() @@ -101,6 +102,7 @@ class User(graphene.ObjectType): openid_uid=user.openid_uid, first_name=user.first_name, last_name=user.last_name, + name_collision_id=user.name_collision_id, email=user.email, is_author=user.is_author, extra=user.extra, @@ -118,6 +120,7 @@ class User(graphene.ObjectType): class Author(graphene.ObjectType): first_name = graphene.String() last_name = graphene.String() + name_collision_id = graphene.Int() total_reports = graphene.Int() extra = JSONString() reports = relay.ConnectionField(ReportConnection) @@ -131,6 +134,7 @@ class Author(graphene.ObjectType): id=user.id, first_name=user.first_name, last_name=user.last_name, + name_collision_id=user.name_collision_id, extra=user.extra, total_reports=user.total_reports, ) diff --git a/tests/schema/snapshots/snap_test_authors.py b/tests/schema/snapshots/snap_test_authors.py index 9f8b74d06acc3d7d253802a719deb9bad622a542..c8dcecbfdd1c4f9b0f3ee8e85c07cd5c2c61e5f8 100644 --- a/tests/schema/snapshots/snap_test_authors.py +++ b/tests/schema/snapshots/snap_test_authors.py @@ -18,6 +18,7 @@ snapshots['test_all 1'] = { 'firstName': 'Shaun', 'id': 'QXV0aG9yOjM=', 'lastName': 'Sheep', + 'nameCollisionId': 0, 'totalReports': 0 } }, @@ -28,6 +29,7 @@ snapshots['test_all 1'] = { 'firstName': 'Spongebob', 'id': 'QXV0aG9yOjI=', 'lastName': 'Squarepants', + 'nameCollisionId': 0, 'totalReports': 0 } }, @@ -38,6 +40,7 @@ snapshots['test_all 1'] = { 'firstName': 'Winston', 'id': 'QXV0aG9yOjE=', 'lastName': 'Wolfe', + 'nameCollisionId': 0, 'totalReports': 0 } } @@ -64,6 +67,7 @@ snapshots['test_first 1'] = { 'firstName': 'Shaun', 'id': 'QXV0aG9yOjM=', 'lastName': 'Sheep', + 'nameCollisionId': 0, 'totalReports': 0 } }, @@ -74,6 +78,7 @@ snapshots['test_first 1'] = { 'firstName': 'Spongebob', 'id': 'QXV0aG9yOjI=', 'lastName': 'Squarepants', + 'nameCollisionId': 0, 'totalReports': 0 } } @@ -100,6 +105,7 @@ snapshots['test_first_after 1'] = { 'firstName': 'Spongebob', 'id': 'QXV0aG9yOjI=', 'lastName': 'Squarepants', + 'nameCollisionId': 0, 'totalReports': 0 } } @@ -143,6 +149,7 @@ snapshots['test_last_before 1'] = { 'firstName': 'Spongebob', 'id': 'QXV0aG9yOjI=', 'lastName': 'Squarepants', + 'nameCollisionId': 0, 'totalReports': 0 } } @@ -168,6 +175,7 @@ snapshots['test_with_reports 1'] = { 'firstName': 'Winston', 'id': 'QXV0aG9yOjE=', 'lastName': 'Wolfe', + 'nameCollisionId': 0, 'reports': { 'edges': [ { diff --git a/tests/schema/snapshots/snap_test_node.py b/tests/schema/snapshots/snap_test_node.py index dd7b1cff55545c0ea4002c5c57f82b004bfca38d..b4cb9ab2ad87c53eec9a0d566cd989ecca68d215 100644 --- a/tests/schema/snapshots/snap_test_node.py +++ b/tests/schema/snapshots/snap_test_node.py @@ -23,6 +23,7 @@ snapshots['test_author 1'] = { 'firstName': 'Winston', 'id': 'QXV0aG9yOjU=', 'lastName': 'Wolfe', + 'nameCollisionId': 0, 'totalReports': 0 } } @@ -42,6 +43,7 @@ snapshots['test_report 1'] = { 'firstName': 'Winston', 'id': 'QXV0aG9yOjE=', 'lastName': 'Wolfe', + 'nameCollisionId': 0, 'totalReports': 1 }, 'body': 'Long story short: we got the Ring!', @@ -78,6 +80,7 @@ snapshots['test_user 1'] = { 'id': 'VXNlcjo4', 'isAuthor': False, 'lastName': 'Einstein', + 'nameCollisionId': 0, 'openidUid': 'albert@einstein.id' } } diff --git a/tests/schema/snapshots/snap_test_search_reports.py b/tests/schema/snapshots/snap_test_search_reports.py index 3dd6bcc6e5360945ed20f1bf29d4f9b87a307a5e..ed5b20b795f1cb0bea7e14509c442283682e7e2a 100644 --- a/tests/schema/snapshots/snap_test_search_reports.py +++ b/tests/schema/snapshots/snap_test_search_reports.py @@ -19,6 +19,7 @@ snapshots['test_all 1'] = { 'firstName': 'Spongebob', 'id': 'QXV0aG9yOjI=', 'lastName': 'Squarepants', + 'nameCollisionId': 0, 'totalReports': 1 }, 'body': 'Another long story.', @@ -41,6 +42,7 @@ snapshots['test_all 1'] = { 'firstName': 'Winston', 'id': 'QXV0aG9yOjE=', 'lastName': 'Wolfe', + 'nameCollisionId': 0, 'totalReports': 2 }, 'body': 'Aragorn is the King. And we have lost the Ring.', @@ -63,6 +65,7 @@ snapshots['test_all 1'] = { 'firstName': 'Winston', 'id': 'QXV0aG9yOjE=', 'lastName': 'Wolfe', + 'nameCollisionId': 0, 'totalReports': 2 }, 'body': 'Long story short: we got the Ring!', @@ -101,6 +104,7 @@ snapshots['test_query 1'] = { 'firstName': 'Spongebob', 'id': 'QXV0aG9yOjI=', 'lastName': 'Squarepants', + 'nameCollisionId': 0, 'totalReports': 1 }, 'body': 'Another long story.', @@ -133,6 +137,7 @@ snapshots['test_highlight 1'] = { 'firstName': 'Winston', 'id': 'QXV0aG9yOjE=', 'lastName': 'Wolfe', + 'nameCollisionId': 0, 'totalReports': 2 }, 'body': 'Aragorn is the King. And we have lost the <mark>Ring</mark>.', @@ -155,6 +160,7 @@ snapshots['test_highlight 1'] = { 'firstName': 'Winston', 'id': 'QXV0aG9yOjE=', 'lastName': 'Wolfe', + 'nameCollisionId': 0, 'totalReports': 2 }, 'body': 'Long story short: we got the <mark>Ring</mark>!', diff --git a/tests/schema/snapshots/snap_test_viewer.py b/tests/schema/snapshots/snap_test_viewer.py index 947e074adf4a51eafab207cdbfb2dfc7672b131b..9a897fb14ebbdac06722ddaa5eaf2655920d700a 100644 --- a/tests/schema/snapshots/snap_test_viewer.py +++ b/tests/schema/snapshots/snap_test_viewer.py @@ -22,6 +22,7 @@ snapshots['test_authenticated 1'] = { 'id': 'VXNlcjox', 'isAuthor': True, 'lastName': 'Wolfe', + 'nameCollisionId': 0, 'openidUid': 'TheWolf' } } diff --git a/tests/schema/test_authors.py b/tests/schema/test_authors.py index b582d865b2dd7ef67555b3593d893af1ea050939..1547ec2103aa5a374539a816813bc3dc8723c440 100644 --- a/tests/schema/test_authors.py +++ b/tests/schema/test_authors.py @@ -21,6 +21,7 @@ def test_all(client, snapshot): id firstName lastName + nameCollisionId totalReports extra } @@ -49,6 +50,7 @@ def test_first(client, snapshot): id firstName lastName + nameCollisionId totalReports extra } @@ -77,6 +79,7 @@ def test_first_after(client, snapshot): id firstName lastName + nameCollisionId totalReports extra } @@ -105,6 +108,7 @@ def test_last(client, snapshot): id firstName lastName + nameCollisionId totalReports extra } @@ -133,6 +137,7 @@ def test_last_before(client, snapshot): id firstName lastName + nameCollisionId totalReports extra } @@ -159,6 +164,7 @@ def test_with_reports(client, snapshot): id firstName lastName + nameCollisionId totalReports extra reports { diff --git a/tests/schema/test_node.py b/tests/schema/test_node.py index 02b12aada13852404e1de7743b9e204f4f357e2c..d475d4c24cf9dd59bd4c2746c1721c1c3a02e01c 100644 --- a/tests/schema/test_node.py +++ b/tests/schema/test_node.py @@ -41,6 +41,7 @@ def test_author(client, snapshot): id firstName lastName + nameCollisionId totalReports extra }} @@ -84,6 +85,7 @@ def test_report(client, snapshot): id firstName lastName + nameCollisionId totalReports extra }} @@ -104,6 +106,7 @@ def test_user__unauthorized(client, snapshot): id firstName lastName + nameCollisionId openidUid isAuthor extra @@ -127,6 +130,7 @@ def test_user__not_a_viewer(client, snapshot): id firstName lastName + nameCollisionId openidUid isAuthor extra @@ -148,6 +152,7 @@ def test_user(client, snapshot): id firstName lastName + nameCollisionId openidUid isAuthor extra diff --git a/tests/schema/test_search_reports.py b/tests/schema/test_search_reports.py index 1309dda7ac5217c8090f1d3793a57bc010ae085b..2d2344a5f6aab82b09f836f5744297b44f10f555 100644 --- a/tests/schema/test_search_reports.py +++ b/tests/schema/test_search_reports.py @@ -29,6 +29,7 @@ def test_all(client, snapshot): id firstName lastName + nameCollisionId totalReports extra } @@ -69,6 +70,7 @@ def test_query(client, snapshot): id firstName lastName + nameCollisionId totalReports extra } @@ -103,6 +105,7 @@ def test_highlight(client, snapshot): id firstName lastName + nameCollisionId totalReports extra } diff --git a/tests/schema/test_viewer.py b/tests/schema/test_viewer.py index 4ab66d2c54d60bf97fc47ea0d169bf855b85dd3b..bf22119068d57603879e70d527a07fbf1748aeee 100644 --- a/tests/schema/test_viewer.py +++ b/tests/schema/test_viewer.py @@ -34,6 +34,7 @@ def test_authenticated(client, snapshot): id firstName lastName + nameCollisionId email openidUid isAuthor