Skip to content

Created test for dashboard.#105

Merged
jberkus merged 1 commit into
elekto-dev:mainfrom
CheatCodeSam:dashboard-tests
Feb 7, 2025
Merged

Created test for dashboard.#105
jberkus merged 1 commit into
elekto-dev:mainfrom
CheatCodeSam:dashboard-tests

Conversation

@CheatCodeSam
Copy link
Copy Markdown
Collaborator

Few changes here. I got the tests to spawn an sqlite database and test against that. Depending on if the app is running in pytest or not, it's going to use .env or .env.testing. So we can run test in one database and dev/prod in another. I've also added pytest-mock so we can snub out some of the repository checks.

The each individual test is automatically going to migrate the database on startup and drop it on shutdown. I've been running it against "testing.db" and I haven't had any issues with it.

I think this is a good place to go to start really testing this thing. I'd rather not mock out as much as we can.

@jberkus
Copy link
Copy Markdown
Member

jberkus commented Feb 7, 2025

Looks good, merging.

Please pull a change from Main, though; I fixed the Raise statement in config.py.

@jberkus jberkus merged commit 7283ff3 into elekto-dev:main Feb 7, 2025
@jberkus
Copy link
Copy Markdown
Member

jberkus commented Feb 7, 2025

Also: maybe we should supply an .env.testing? I don't see any good reason to have that be user-generated.

@CheatCodeSam
Copy link
Copy Markdown
Collaborator Author

@jberkus
That sounds like a great idea, I'll add one to my next PR. I'm thinking of tackling that lowercase issue next. #99

@jberkus
Copy link
Copy Markdown
Member

jberkus commented Feb 17, 2025

That would def be the highest-priority one. The problem is that we need to test almost every path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants