mocks.go 333 B

1234567891011121314151617
  1. // Copyright 2020 The Gogs Authors. All rights reserved.
  2. // Use of this source code is governed by a MIT-style
  3. // license that can be found in the LICENSE file.
  4. package database
  5. import (
  6. "testing"
  7. )
  8. func SetMockUsersStore(t *testing.T, mock UsersStore) {
  9. before := Users
  10. Users = mock
  11. t.Cleanup(func() {
  12. Users = before
  13. })
  14. }