Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Clean up template locale usage (#27856) | wxiaoguang | 2023-10-31 | 1 | -0/+1 |
| | | | | | | | | | | | | | | | | | After many refactoring PRs for the "locale" and "template context function", now the ".locale" is not needed for web templates any more. This PR does a clean up for: 1. Remove `ctx.Data["locale"]` for web context. 2. Use `ctx.Locale` in `500.tmpl`, for consistency. 3. Add a test check for `500 page` locale usage. 4. Remove the `Str2html` and `DotEscape` from mail template context data, they are copy&paste errors introduced by #19169 and #16200 . These functions are template functions (provided by the common renderer), but not template data variables. 5. Make email `SendAsync` function mockable (I was planning to add more tests but it would make this PR much too complex, so the tests could be done in another PR) | ||||
* | make writing main test easier (#27270) | Lunny Xiao | 2023-09-28 | 1 | -4/+1 |
| | | | | | | | | | This PR removed `unittest.MainTest` the second parameter `TestOptions.GiteaRoot`. Now it detects the root directory by current working directory. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> | ||||
* | Fix admin config page error, use tests to cover the admin config and 500 ↵ | wxiaoguang | 2023-05-29 | 1 | -0/+41 |
error page (#24965) The admin config page has been broken for many many times, a little refactoring would make this page panic. So, add a test for it, and add another test to cover the 500 error page. Co-authored-by: Giteabot <teabot@gitea.io> |