Skip to content

Commit

Permalink
Merge pull request #2 from stuartmaxwell/dev
Browse files Browse the repository at this point in the history
Update project for testing and example improvements
  • Loading branch information
stuartmaxwell authored May 27, 2024
2 parents 16f3d8b + 5aaedcf commit 52d1b60
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 11 deletions.
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

0 comments on commit 52d1b60

Please sign in to comment.