mirror of
https://github.com/ManyakRus/starter.git
synced 2025-11-26 23:10:42 +02:00
сделал ReplaceSchemaName()
This commit is contained in:
@@ -336,3 +336,13 @@ func TestSetSingularTableNames(t *testing.T) {
|
||||
t.Errorf("Expected SingularTable to be %v, but got %v", IsSingular, NamingStrategy.SingularTable)
|
||||
}
|
||||
}
|
||||
|
||||
func TestReplaceSchemaName(t *testing.T) {
|
||||
TextSQL := "SELECT * FROM public.users"
|
||||
Settings.DB_SCHEMA = "myschema"
|
||||
ExpectedSQL := "SELECT * FROM myschema.users"
|
||||
ActualSQL := ReplaceSchemaName(TextSQL, "public")
|
||||
if ActualSQL != ExpectedSQL {
|
||||
t.Errorf("Expected %v, but got %v", ExpectedSQL, ActualSQL)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user