🐛(back) add missing color option for project colors

Signed-off-by: Laurent Paoletti <lp@providenz.fr>
This commit is contained in:
Laurent Paoletti
2026-03-18 16:51:19 +01:00
parent 9e37f71818
commit f5a1b72913
4 changed files with 24 additions and 0 deletions
+4
View File
@@ -17,6 +17,10 @@ and this project adheres to
- ⬆️(dependencies) upgrade Next.js 15 to 16, upgrade python dependencies
### Fixed
- 🐛(back) add missing color option for project colors
## [0.0.14] - 2026-03-11
### Added
@@ -87,6 +87,7 @@ class Migration(migrations.Migration):
("color_7", "Color 7"),
("color_8", "Color 8"),
("color_9", "Color 9"),
("color_10", "Color 10"),
],
help_text="Project icon color",
max_length=20,
+1
View File
@@ -52,6 +52,7 @@ class ChatProjectColor(models.TextChoices):
COLOR_7 = "color_7", "Color 7"
COLOR_8 = "color_8", "Color 8"
COLOR_9 = "color_9", "Color 9"
COLOR_10 = "color_10", "Color 10"
class ChatProject(BaseModel):
@@ -78,6 +78,24 @@ def test_create_project_with_llm_instructions(api_client):
assert project.llm_instructions == "Always answer in French."
@pytest.mark.parametrize("color", ChatProjectColor)
def test_create_project_with_each_color(api_client, color):
"""Test creating a project with each available color."""
user = UserFactory()
url = "/api/v1.0/projects/"
data = {
"title": "Color Project",
"icon": ChatProjectIcon.FOLDER,
"color": color,
}
api_client.force_login(user)
response = api_client.post(url, data, format="json")
assert response.status_code == status.HTTP_201_CREATED
project = ChatProject.objects.get(id=response.data["id"])
assert project.color == color
def test_create_project_anonymous(api_client):
"""Test creating a project as an anonymous user returns a 401 error."""
url = "/api/v1.0/projects/"