aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/apps/content/tests (follow)
Commit message (Collapse)AuthorAgeLines
* Upsert tags in two queriesGravatar Johannes Christ2024-04-01-1/+11
| | | | | | | | | | | Before, we had an N+1 query, where each tag would be separately fetched and updated. Instead, first delete any tags we no longer care about, then perform an upsert of all fields except for `last_commit`, which we want to keep from the existing tag. This comes with one caveat: on the first update of the tags, the `tags` list is no longer modified in-place, because mutation is bad, however, the database state is updated accordingly.
* Use the new datetime.UTC alias over datetime.timezone.utcGravatar Chris Lovering2023-05-13-1/+1
|
* Do not duplicate "Edit on GitHub" link for tagsGravatar Johannes Christ2023-05-10-0/+8
| | | | Closes #963.
* Switch to ruff for lintingGravatar Johannes Christ2023-05-10-10/+10
|
* Make unittests independent of GitHub (#948)Gravatar Johannes Christ2023-04-22-2/+3
| | | | | | | | | This fixes a problem where running the unit tests successively a lot would result in 403 ratelimit exceeded errors being thrown due to the GitHub API being called by the app. Fixes #918 Co-authored-by: wookie184 <[email protected]>
* Register cleanup job after module loadGravatar Johannes Christ2023-03-25-5/+1
|
* Drop dependency to pyfakefsGravatar Johannes Christ2023-03-25-30/+33
| | | | | | | | | | | | | | | Create a temporary directory to manage our resource tests instead of reyling on pyfakefs to mock it away for us. This also makes the code more portable: all we need now is a way to create a temporary directory. `pathlib` mostly abstracts away the other parts for us. Since we're well-behaved, we clean up the temporary directory at the end of the Python interpreter's life using `atexit` and `shutil.rmtree`. This PR was written and tested with Python 3.9 which required some hacks in `pyproject.toml` to make it work, it may require re-locking if CI throws up. Closes #679.
* Merge branch 'main' into bot-tagsGravatar Hassan Abouelela2022-10-27-1/+1
|\ | | | | | | | | | | | | | | | | Signed-off-by: Hassan Abouelela <[email protected]> # Conflicts: # poetry.lock # pydis_site/settings.py # pyproject.toml
| * Fix Unittest Deprecation WarningsGravatar Hassan Abouelela2022-09-04-1/+1
| | | | | | | | Signed-off-by: Hassan Abouelela <[email protected]>
* | Rename Tag Model Author FieldGravatar Hassan Abouelela2022-08-23-4/+4
| | | | | | | | | | | | | | Renames the tag model `author` field to `authors` to better indicate what's contained in the field, and updates the documentation. Signed-off-by: Hassan Abouelela <[email protected]>
* | Support Hyperlinked Tag Group ReplacementGravatar Hassan Abouelela2022-08-23-0/+28
| | | | | | | | Signed-off-by: Hassan Abouelela <[email protected]>
* | Fix Tests For Tag MetadataGravatar Hassan Abouelela2022-08-16-25/+143
| | | | | | | | Signed-off-by: Hassan Abouelela <[email protected]>
* | Update Tests For Tag GroupsGravatar Hassan Abouelela2022-08-14-23/+155
| | | | | | | | Signed-off-by: Hassan Abouelela <[email protected]>
* | Move Tag URL To Property And Add GroupGravatar Hassan Abouelela2022-08-14-9/+9
| | | | | | | | | | | | | | | | | | The URLs can be simply constructed using the other tag properties, so they were removed from the database in favor of a property. A group field was also added to support tags within groups. Signed-off-by: Hassan Abouelela <[email protected]>
* | Add Tag View TestsGravatar Hassan Abouelela2022-08-13-1/+230
|/ | | | Signed-off-by: Hassan Abouelela <[email protected]>
* Fixes Test Paths For Windows (#596)Gravatar Hassan Abouelela2021-10-17-3/+8
| | | | | | Fixes a test that fails on Windows due to differing path separators. This is currently the only failing test. Signed-off-by: Hassan Abouelela <[email protected]>
* Fix `content` app tests not running on macOS (#519)Gravatar Johannes Christ2021-06-06-41/+51
| | | | | | | | | | | macOS uses `/var/...` as its temp directory, causing issues with the hardcoded usage of `/tmp` as the temporary directory. Therefore, relying on tmp is not portable. Populating the true temporary directory is redundant and may cause more problems because of nested directories. Move the fake content under a subdirectory to avoid this issue. Co-authored-by: MarkKoz <[email protected]>
* Use metadata titles in Sub-Articles dropdown.Gravatar kosayoda2021-04-02-14/+2
| | | | | | This allows us to keep filenames (thus URLs) as concise as possible, while having a more descriptive entry in the Sub-Articles dropdown for category pages.
* Fix overriden PAGES_PATH in settings.py.Gravatar kosayoda2021-04-01-1/+1
| | | | | This was causing mysterious 404s because while migrating a feature to dewikification, the same variable would be placed in the settings file.
* Add a dropdown menu listing direct children.Gravatar kosayoda2021-04-01-1/+14
| | | | | This only shows when the page is also a category, since regular pages have no children and regular categories already list their children.
* Place category pages in the same directory as categories.Gravatar kosayoda2021-04-01-3/+2
|
* Add new tests to achieve full coverage.Gravatar kosayoda2021-03-29-6/+37
|
* Fix failing tests.Gravatar kosayoda2021-03-29-9/+26
|
* Refactor content app tests.Gravatar kosayoda2021-03-25-287/+283
| | | | | | The tests uses pyfakefs to simulate a fake filesystem that is reused over the content app tests. Test coverage for the app is brought to 100%.
* Rename `short_description` to `description`.Gravatar kosayoda2021-03-24-4/+4
| | | | | Given that there is no "long description", just `description` conveys the same information with brevity.
* Fix content app tests.Gravatar kosayoda2021-03-24-45/+37
|
* Rename `articles` to `pages`.Gravatar kosayoda2021-03-23-98/+99
| | | | | | Articles was a good name, but we want an `articles` category in the future. `/pages/guides/` and `/pages/articles/` are clearer in name than `/articles/guides/` and `/articles/articles/`.
* Remove Github metadata feature.Gravatar kosayoda2021-03-23-49/+1
| | | | | This feature is still under implementation debate, so it will be further discussed in another issue and implemeneted in a future PR.
* Update tests to match with recent unlimited subcategories changesGravatar ks1292020-11-28-83/+148
|
* Add testing subcategory and article into itGravatar ks1292020-11-28-0/+8
|
* Update content app views testsGravatar ks1292020-10-30-9/+13
|
* Cover fetching article GitHub information with testsGravatar ks1292020-10-06-2/+46
|
* Rename last guides test to articles testsGravatar ks1292020-10-06-5/+5
|
* Rename content -> articles for visual partGravatar ks1292020-10-06-7/+7
|
* Fix content app lintingGravatar ks1292020-10-05-9/+7
|
* Migrate content system from Python-Markdown to markdown2Gravatar ks1292020-10-05-30/+46
|
* Move from standard OS path actions to PathlibGravatar ks1292020-10-04-12/+7
|
* Change guides system to content systemGravatar ks1292020-10-04-0/+249
As this system will be used for more than just guides, I had to do some refactoring to match this system with plans. Basically now there isn't guides, but articles instead.