tests

package
v0.0.0-...-ee9efa2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 20, 2025 License: GPL-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const MASTER_PASSWORD = "testpassword"

Variables

This section is empty.

Functions

func AccessToken

func AccessToken(db *gorm.DB, user models.User) string

func BookData

func BookData(db *gorm.DB, user models.User) models.Book

func ChapterData

func ChapterData(db *gorm.DB, book models.Book) models.Chapter

func CloseTestDatabase

func CloseTestDatabase(db *gorm.DB)

func ConvertDateTime

func ConvertDateTime(timeObj time.Time) string

func CreateSingleTable

func CreateSingleTable(db *gorm.DB, model interface{})

func CreateTempImageFile

func CreateTempImageFile(t *testing.T) string

func DropAndCreateSingleTable

func DropAndCreateSingleTable(db *gorm.DB, model interface{})

func GenreData

func GenreData(db *gorm.DB) models.Genre

func JwtData

func JwtData(db *gorm.DB, user models.User) models.AuthToken

func NotificationData

func NotificationData(db *gorm.DB, sender models.User, receiver models.User) models.Notification

func ParagraphCommentData

func ParagraphCommentData(db *gorm.DB, paragraph models.Paragraph, user models.User) models.Comment

func ParseResponseBody

func ParseResponseBody(t *testing.T, b io.ReadCloser) interface{}

func ProcessJsonTestBody

func ProcessJsonTestBody(t *testing.T, app *fiber.App, url string, method string, body interface{}, access ...string) *http.Response

func ProcessMultipartTestBody

func ProcessMultipartTestBody(t *testing.T, app *fiber.App, url string, method string, body interface{}, fileFieldNames []string, filePaths []string, access ...string) *http.Response

func ProcessTestGetOrDelete

func ProcessTestGetOrDelete(app *fiber.App, url string, method string, access ...string) *http.Response

func RemoveCreatedAndUpdated

func RemoveCreatedAndUpdated(body map[string]interface{}, dataType string)

func ReplyData

func ReplyData(db *gorm.DB, review models.Comment, user models.User) models.Comment

func ReviewData

func ReviewData(db *gorm.DB, book models.Book, user models.User) models.Comment

func Setup

func Setup(t *testing.T, app *fiber.App) *gorm.DB

func SetupTestDatabase

func SetupTestDatabase(t *testing.T) *gorm.DB

func TagData

func TagData(db *gorm.DB) models.Tag

BOOKS TEST DATA

func TestAdmin

func TestAdmin(db *gorm.DB) models.User

ADMIN TEST DATA

func TestAuthor

func TestAuthor(db *gorm.DB, another ...bool) models.User

func TestCoin

func TestCoin(db *gorm.DB) models.Coin

WALLET TEST DATA

func TestSubscriber

func TestSubscriber(db *gorm.DB) models.User

func TestSubscriptionPlan

func TestSubscriptionPlan(db *gorm.DB) models.SubscriptionPlan

func TestTransaction

func TestTransaction(db *gorm.DB, user models.User) models.Transaction

func TestUser

func TestUser(db *gorm.DB) models.User

AUTH FIXTURES

func TestVerifiedUser

func TestVerifiedUser(db *gorm.DB, activeSub ...bool) models.User

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL