Skip to content

Commit ce00bd8

Browse files
committed
Add user service tests for superuser creation
1 parent a26660f commit ce00bd8

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import pytest
2+
3+
from prometheus.app.services.database_service import DatabaseService
4+
from prometheus.app.services.user_service import UserService
5+
from tests.test_utils.fixtures import postgres_container_fixture
6+
7+
8+
@pytest.fixture
9+
def mock_database_service(postgres_container_fixture):
10+
service = DatabaseService(postgres_container_fixture.get_connection_url())
11+
service.start()
12+
return service
13+
14+
15+
def test_create_superuser(mock_database_service):
16+
# Exercise
17+
service = UserService(mock_database_service)
18+
service.create_superuser(
19+
"testuser",
20+
"test@gmail.com",
21+
"password123",
22+
github_token="gh_token"
23+
)
24+
25+
# TODO test login

0 commit comments

Comments
 (0)