Fixes invalid authorname in explore (#4054)

* Fixes #3341, #4018
* Defined two feild author and user in Media and used them at the corresponding places
Minor bug fixes
-displaying userName in uploadedBy.
-modified HTML parsing in getArtist.
-Replaced creator with author.

* Fixes #3341, #4018
* Defined two feild author and user in Media and used them at the corresponding places
Minor bug fixes
-displaying userName in uploadedBy.
-modified HTML parsing in getArtist.
-Replaced creator with author.
This commit is contained in:
Ashish 2020-12-01 19:26:41 +05:30 committed by GitHub
parent f1b40728b2
commit d720750ab4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 56 additions and 61 deletions

View file

@ -56,7 +56,7 @@ class DeleteHelperTest {
whenever(media.displayTitle).thenReturn("Test file")
val creatorName = "Creator"
whenever(media.creator).thenReturn("$creatorName (page does not exist)")
whenever(media.author).thenReturn("$creatorName")
whenever(media.filename).thenReturn("Test file.jpg")
val makeDeletion = deleteHelper.makeDeletion(context, media, "Test reason")?.blockingGet()
@ -78,7 +78,7 @@ class DeleteHelperTest {
.thenReturn(Observable.just(true))
whenever(media.displayTitle).thenReturn("Test file")
whenever(media.filename).thenReturn("Test file.jpg")
whenever(media.creator).thenReturn("Creator (page does not exist)")
whenever(media.author).thenReturn("Creator (page does not exist)")
deleteHelper.makeDeletion(context, media, "Test reason")?.blockingGet()
}
@ -93,7 +93,7 @@ class DeleteHelperTest {
.thenReturn(Observable.just(false))
whenever(media.displayTitle).thenReturn("Test file")
whenever(media.filename).thenReturn("Test file.jpg")
whenever(media.creator).thenReturn("Creator (page does not exist)")
whenever(media.author).thenReturn("Creator (page does not exist)")
deleteHelper.makeDeletion(context, media, "Test reason")?.blockingGet()
}
@ -108,7 +108,7 @@ class DeleteHelperTest {
.thenReturn(Observable.just(true))
whenever(media.displayTitle).thenReturn("Test file")
whenever(media.filename).thenReturn("Test file.jpg")
whenever(media.creator).thenReturn("Creator (page does not exist)")
whenever(media.author).thenReturn("Creator (page does not exist)")
deleteHelper.makeDeletion(context, media, "Test reason")?.blockingGet()
}
@ -125,7 +125,7 @@ class DeleteHelperTest {
whenever(media.displayTitle).thenReturn("Test file")
whenever(media.filename).thenReturn("Test file.jpg")
whenever(media.creator).thenReturn(null)
whenever(media.author).thenReturn(null)
deleteHelper.makeDeletion(context, media, "Test reason")?.blockingGet()
}

View file

@ -52,7 +52,7 @@ class UploadControllerTest {
val contribution = mock(Contribution::class.java)
val media = mock<Media>()
whenever(contribution.media).thenReturn(media)
whenever(media.creator).thenReturn("Creator")
whenever(media.author).thenReturn("Creator")
uploadController!!.startUpload(contribution)
}
}