|
1 | 1 | import pytest |
2 | 2 | from aiopynamodb.models import Model |
3 | 3 |
|
4 | | -from fastapi_users_db_dynamodb import config |
| 4 | +from fastapi_users_db_dynamodb import DynamoDBBaseUserTable, config |
5 | 5 | from fastapi_users_db_dynamodb._generics import classproperty |
| 6 | +from fastapi_users_db_dynamodb.access_token import DynamoDBBaseAccessTokenTable |
6 | 7 | from fastapi_users_db_dynamodb.attributes import GUID |
7 | 8 | from fastapi_users_db_dynamodb.tables import delete_tables, ensure_tables_exist |
8 | 9 |
|
@@ -94,6 +95,24 @@ def test_config(monkeypatch): |
94 | 95 | config.set("DATABASE_REGION", region) |
95 | 96 | assert config.get("DATABASE_REGION") == region |
96 | 97 |
|
| 98 | + # Test Meta definitions |
| 99 | + assert DynamoDBBaseUserTable.Meta.table_name == config.get( |
| 100 | + "DATABASE_USERTABLE_NAME" |
| 101 | + ) |
| 102 | + assert DynamoDBBaseAccessTokenTable.Meta.table_name == config.get( |
| 103 | + "DATABASE_TOKENTABLE_NAME" |
| 104 | + ) |
| 105 | + assert ( |
| 106 | + DynamoDBBaseUserTable.Meta.region |
| 107 | + == DynamoDBBaseAccessTokenTable.Meta.region |
| 108 | + == config.get("DATABASE_REGION") |
| 109 | + ) |
| 110 | + assert ( |
| 111 | + DynamoDBBaseUserTable.Meta.billing_mode |
| 112 | + == DynamoDBBaseAccessTokenTable.Meta.billing_mode |
| 113 | + == config.get("DATABASE_BILLING_MODE").value |
| 114 | + ) |
| 115 | + |
97 | 116 |
|
98 | 117 | def test_attributes(user_id): |
99 | 118 | """Test serialization and deserialization of `Attribute` instances. |
|
0 commit comments