Hack to fix tests not passing. Unclear why the filters are being set to nil.
authorMark Felder <feld@feld.me>
Thu, 14 Jan 2021 23:49:37 +0000 (17:49 -0600)
committerMark Felder <feld@feld.me>
Thu, 14 Jan 2021 23:49:37 +0000 (17:49 -0600)
Both of these changes are needed or it doesn't work.

lib/pleroma/upload/filter.ex
test/support/data_case.ex

index 66113563494a5a72d442c9c9587817ecaa941403..367acd2146d147a4240d433dce73c5429224b8a8 100644 (file)
@@ -43,4 +43,6 @@ defmodule Pleroma.Upload.Filter do
         error
     end
   end
+
+  def filter(nil, upload), do: filter([], upload)
 end
index 0b41f0f635a7cd0ccffc38e239d3f1d237f89046..23c858d2a94f9326d1ce9fbf7226cd221541eead 100644 (file)
@@ -107,7 +107,7 @@ defmodule Pleroma.DataCase do
   def ensure_local_uploader(context) do
     test_uploader = Map.get(context, :uploader, Pleroma.Uploaders.Local)
     uploader = Pleroma.Config.get([Pleroma.Upload, :uploader])
-    filters = Pleroma.Config.get([Pleroma.Upload, :filters])
+    filters = Pleroma.Config.get([Pleroma.Upload, :filters]) || []
 
     Pleroma.Config.put([Pleroma.Upload, :uploader], test_uploader)
     Pleroma.Config.put([Pleroma.Upload, :filters], [])