@@ -1147,13 +1147,15 @@ List of mailboxes. Each mailbox has id, email, default, creation_timestamp field
"email": "a@b.c",
"id": 1,
"default": true,
- "creation_timestamp": 1590918512
+ "creation_timestamp": 1590918512,
+ "nb_alias": 10
},
{
"email": "m1@example.com",
"id": 2,
"default": false,
+ "nb_alias": 0
}
]
@@ -163,6 +163,7 @@ def get_mailboxes():
- email
- default: boolean - whether the mailbox is the default one
- creation_timestamp
+ - nb_alias
"""
user = g.user
@@ -174,6 +175,7 @@ def get_mailboxes():
"email": mb.email,
"default": user.default_mailbox_id == mb.id,
"creation_timestamp": mb.created_at.timestamp,
+ "nb_alias": mb.nb_alias(),
for mb in user.mailboxes()
@@ -187,5 +187,4 @@ def test_get_mailboxes(flask_client):
assert "id" in mb
assert "default" in mb
assert "creation_timestamp" in mb
-
- print(r.json)
+ assert "nb_alias" in mb