File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -1046,6 +1046,33 @@ def test_check_returns_matching_auto_tags(self):
1046
1046
1047
1047
self .assertCountEqual (auto_tags , ["tag1" , "tag2" ])
1048
1048
1049
+ def test_check_disable_cache_clears_metadata_cache (self ):
1050
+ self .authenticate ()
1051
+
1052
+ self .patch_load_website_metadata = patch .object (
1053
+ website_loader ,
1054
+ "load_website_metadata" ,
1055
+ return_value = WebsiteMetadata (
1056
+ "https://example.com" ,
1057
+ "Scraped metadata" ,
1058
+ "Scraped description" ,
1059
+ "https://example.com/preview.png" ,
1060
+ )
1061
+ ).start ()
1062
+ self .patch_cache_clear = patch .object (website_loader .load_website_metadata , "cache_clear" ).start ()
1063
+
1064
+ url = reverse ("bookmarks:bookmark-check" )
1065
+ check_url = urllib .parse .quote_plus ("https://example.com" )
1066
+ response = self .get (
1067
+ f"{ url } ?url={ check_url } &disable_cache=true" , expected_status_code = status .HTTP_200_OK
1068
+ )
1069
+
1070
+ self .patch_cache_clear .assert_called_once ()
1071
+ self .patch_load_website_metadata .assert_called_once ()
1072
+
1073
+ self .patch_cache_clear .stop ()
1074
+ self .patch_load_website_metadata .stop ()
1075
+
1049
1076
def test_can_only_access_own_bookmarks (self ):
1050
1077
self .authenticate ()
1051
1078
self .setup_bookmark ()
You can’t perform that action at this time.
0 commit comments