Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update project for testing and example improvements #2

Merged
merged 9 commits into from
May 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"python.testing.pytestArgs": ["tests", "-v"],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true
}
2 changes: 1 addition & 1 deletion djpress/app_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
CACHE_RECENT_PUBLISHED_POSTS: bool = False
RECENT_PUBLISHED_POSTS_COUNT: int = 20
MARKDOWN_EXTENSIONS: list = ["fenced_code", "codehilite", "tables"]
BLOG_TITLE: str = ""
BLOG_TITLE: str = "My DJ Press Blog"

# DJPress URL settings
CATEGORY_PATH_ENABLED: bool = True
Expand Down
8 changes: 8 additions & 0 deletions example/config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@
"BACKEND": "django.template.backends.django.DjangoTemplates",
"DIRS": [BASE_DIR / "templates"],
"APP_DIRS": True,
"OPTIONS": {
"context_processors": [
"django.template.context_processors.debug",
"django.template.context_processors.request",
"django.contrib.auth.context_processors.auth",
"django.contrib.messages.context_processors.messages",
],
},
},
]

Expand Down
3 changes: 2 additions & 1 deletion example/config/urls.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
"""URL configuration for config project."""

from django.contrib import admin
from django.urls import path
from django.urls import include, path

urlpatterns = [
path("admin/", admin.site.urls),
path("", include("djpress.urls")),
]
7 changes: 6 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "djpress"
version = "0.3.1"
version = "0.3.2"
authors = [{ name = "Stuart Maxwell", email = "[email protected]" }]
description = "A blog application for Django sites, inspired by classic WordPress."
readme = "README.md"
Expand Down Expand Up @@ -58,3 +58,8 @@ ignore = [

[tool.ruff.lint.pydocstyle]
convention = "google"

[tool.pytest.ini_options]
pythonpath = ". example"
DJANGO_SETTINGS_MODULE = "config.settings_testing"
python_files = "tests.py test_*.py *_tests.py"
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pytest
pytest-django
build
7 changes: 0 additions & 7 deletions tests/settings_testing.py

This file was deleted.

2 changes: 1 addition & 1 deletion tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def create_test_post(user, category):
author=user,
status="published",
post_type="post",
date=timezone.datetime(2024, 1, 1),
date=timezone.make_aware(timezone.datetime(2024, 1, 1)),
)
post.categories.set([category])
return post
Expand Down