diff --git a/test/test_helper.rb b/test/test_helper.rb index 2f6e22593..81ff3b3ef 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -35,22 +35,6 @@ module TestHelpers def as_user(&block) CurrentUser.as(@user, &block) end - - def load_pixiv_tokens! - if ENV["DANBOORU_PERSIST_PIXIV_SESSION"] && Cache.get("pixiv-papi-access-token") - Cache.put("pixiv-papi-access-token", Thread.current[:pixiv_papi_access_token]) - Cache.put(PixivWebAgent::SESSION_CACHE_KEY, Thread.current[:pixiv_session_cache_key]) - Cache.put(PixivWebAgent::COMIC_SESSION_CACHE_KEY, Thread.current[:pixiv_comic_session_cache_key]) - end - end - - def save_pixiv_tokens! - if ENV["DANBOORU_PERSIST_PIXIV_SESSION"] - Thread.current[:pixiv_papi_access_token] = Cache.get("pixiv-papi-access-token") - Thread.current[:pixiv_session_cache_key] = Cache.get(PixivWebAgent::SESSION_CACHE_KEY) - Thread.current[:pixiv_comic_session_cache_key] = Cache.get(PixivWebAgent::COMIC_SESSION_CACHE_KEY) - end - end end class ActiveSupport::TestCase diff --git a/test/unit/downloads/pixiv_test.rb b/test/unit/downloads/pixiv_test.rb index 70b38f35b..a22f8a700 100644 --- a/test/unit/downloads/pixiv_test.rb +++ b/test/unit/downloads/pixiv_test.rb @@ -2,17 +2,6 @@ require 'test_helper' module Downloads class PixivTest < ActiveSupport::TestCase - def setup - super - Downloads::File.stubs(:is_cloudflare?).returns(false) - load_pixiv_tokens! - end - - def teardown - save_pixiv_tokens! - super - end - context "in all cases" do # Test a new illustration (one uploaded after 2014-09-30). New illustrations # must use /img-original/ for full size URLs. Old /imgXX/img/username/ style URLs diff --git a/test/unit/sources/pixiv_test.rb b/test/unit/sources/pixiv_test.rb index 8f00098e1..f4778615e 100644 --- a/test/unit/sources/pixiv_test.rb +++ b/test/unit/sources/pixiv_test.rb @@ -21,16 +21,6 @@ module Sources skip "Remote connection to #{source} failed" end - def setup - super - load_pixiv_tokens! - end - - def teardown - save_pixiv_tokens! - super - end - context "in all cases" do context "A gallery page" do setup do