Skip to content

Commit ae7a8e9

Browse files
committed
Backport fixes for test cases
1 parent bf44859 commit ae7a8e9

File tree

1 file changed

+9
-13
lines changed

1 file changed

+9
-13
lines changed

test/test_apidb_backend_changeset_uploads.cpp

+9-13
Original file line numberDiff line numberDiff line change
@@ -2616,7 +2616,7 @@ TEST_CASE_METHOD( DatabaseTestsFixture, "test_osmchange_bbox_size_limiter", "[ch
26162616
new global_setting_enable_bbox_size_limiter_test_class());
26172617
global_settings::set_configuration(std::move(test_settings));
26182618

2619-
const std::string bearertoken = "Bearer 4f41f2328befed5a33bcabdf14483081c8df996cbafc41e313417776e8fafae8";
2619+
const std::string baseauth = "Basic ZGVtbzpwYXNzd29yZA==";
26202620
const std::string generator = "Test";
26212621

26222622
auto sel_factory = tdb.get_data_selection_factory();
@@ -2630,21 +2630,17 @@ TEST_CASE_METHOD( DatabaseTestsFixture, "test_osmchange_bbox_size_limiter", "[ch
26302630
tdb.run_sql(R"(
26312631
INSERT INTO users (id, email, pass_crypt, pass_salt, creation_time, display_name, data_public, status)
26322632
VALUES
2633-
(1, 'demo@example.com', 'xx', '', '2013-11-14T02:10:00Z', 'demo', true, 'confirmed');
2633+
(1, 'demo@example.com', '3wYbPiOxk/tU0eeIDjUhdvi8aDP3AbFtwYKKxF1IhGg=',
2634+
'sha512!10000!OUQLgtM7eD8huvanFT5/WtWaCwdOdrir8QOtFwxhO0A=',
2635+
'2013-11-14T02:10:00Z', 'demo', true, 'confirmed'),
2636+
(2, 'user_2@example.com', '', '', '2013-11-14T02:10:00Z', 'user_2', false, 'active');
26342637
26352638
INSERT INTO changesets (id, user_id, created_at, closed_at, num_changes)
26362639
VALUES
26372640
(1, 1, now() at time zone 'utc', now() at time zone 'utc' + '1 hour' ::interval, 0),
26382641
(3, 1, now() at time zone 'utc', now() at time zone 'utc' + '1 hour' ::interval, 0);
26392642
26402643
SELECT setval('current_nodes_id_seq', 14000000000, false);
2641-
2642-
INSERT INTO oauth_applications (id, owner_type, owner_id, name, uid, secret, redirect_uri, scopes, confidential, created_at, updated_at)
2643-
VALUES (3, 'User', 1, 'App 1', 'dHKmvGkmuoMjqhCNmTJkf-EcnA61Up34O1vOHwTSvU8', '965136b8fb8d00e2faa2faaaed99c0ec10225518d0c8d9fb1d2af701e87eb68c',
2644-
'http://demo.localhost:3000', 'write_api read_gpx', false, '2021-04-12 17:53:30', '2021-04-12 17:53:30');
2645-
2646-
INSERT INTO public.oauth_access_tokens (id, resource_owner_id, application_id, token, refresh_token, expires_in, revoked_at, created_at, scopes, previous_refresh_token)
2647-
VALUES (67, 1, 3, '4f41f2328befed5a33bcabdf14483081c8df996cbafc41e313417776e8fafae8', NULL, NULL, NULL, '2021-04-14 19:38:21', 'write_api', '');
26482644
26492645
)"
26502646
);
@@ -2671,7 +2667,7 @@ TEST_CASE_METHOD( DatabaseTestsFixture, "test_osmchange_bbox_size_limiter", "[ch
26712667
test_request req;
26722668
req.set_header("REQUEST_METHOD", "POST");
26732669
req.set_header("REQUEST_URI", "/api/0.6/changeset/1/upload");
2674-
req.set_header("HTTP_AUTHORIZATION", bearertoken);
2670+
req.set_header("HTTP_AUTHORIZATION", baseauth);
26752671
req.set_header("REMOTE_ADDR", "127.0.0.1");
26762672

26772673
req.set_payload(R"(<?xml version="1.0" encoding="UTF-8"?>
@@ -2700,7 +2696,7 @@ TEST_CASE_METHOD( DatabaseTestsFixture, "test_osmchange_bbox_size_limiter", "[ch
27002696
test_request req;
27012697
req.set_header("REQUEST_METHOD", "POST");
27022698
req.set_header("REQUEST_URI", "/api/0.6/changeset/3/upload");
2703-
req.set_header("HTTP_AUTHORIZATION", bearertoken);
2699+
req.set_header("HTTP_AUTHORIZATION", baseauth);
27042700
req.set_header("REMOTE_ADDR", "127.0.0.1");
27052701

27062702
req.set_payload(R"(<?xml version="1.0" encoding="UTF-8"?>
@@ -2721,7 +2717,7 @@ TEST_CASE_METHOD( DatabaseTestsFixture, "test_osmchange_bbox_size_limiter", "[ch
27212717
test_request req;
27222718
req.set_header("REQUEST_METHOD", "POST");
27232719
req.set_header("REQUEST_URI", "/api/0.6/changeset/3/upload");
2724-
req.set_header("HTTP_AUTHORIZATION", bearertoken);
2720+
req.set_header("HTTP_AUTHORIZATION", baseauth);
27252721
req.set_header("REMOTE_ADDR", "127.0.0.1");
27262722

27272723
req.set_payload(R"(<?xml version="1.0" encoding="UTF-8"?>
@@ -2745,7 +2741,7 @@ TEST_CASE_METHOD( DatabaseTestsFixture, "test_osmchange_bbox_size_limiter", "[ch
27452741
test_request req;
27462742
req.set_header("REQUEST_METHOD", "POST");
27472743
req.set_header("REQUEST_URI", "/api/0.6/changeset/1/upload");
2748-
req.set_header("HTTP_AUTHORIZATION", bearertoken);
2744+
req.set_header("HTTP_AUTHORIZATION", baseauth);
27492745
req.set_header("REMOTE_ADDR", "127.0.0.1");
27502746

27512747
req.set_payload(R"(<?xml version="1.0" encoding="UTF-8"?>

0 commit comments

Comments
 (0)