Update datetime handling in ApiKey and Variable models (#1673)

* Update datetime handling in ApiKey and Variable models

* Refactor test_login_successful function in test_login.py

* Fix nullable attribute for created_at and updated_at fields in Variable model
This commit is contained in:
Gabriel Luiz Freitas Almeida 2024-04-10 23:04:10 -03:00 • committed by GitHub
commit 836ac08d80
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 24 additions and 18 deletions

View file

@ -1,5 +1,4 @@
import pytest
from langflow.services.database.models.api_key import ApiKeyCreate
@ -7,7 +6,7 @@ from langflow.services.database.models.api_key import ApiKeyCreate
def api_key(client, logged_in_headers, active_user):
api_key = ApiKeyCreate(name="test-api-key")
response = client.post("api/v1/api_key", data=api_key.json(), headers=logged_in_headers)
response = client.post("api/v1/api_key", data=api_key.model_dump_json(), headers=logged_in_headers)
assert response.status_code == 200, response.text
return response.json()