membersystem/tests/test_accounting.py
bbb 43d19d3106 New Service Request setup (#59)
* [x] Adds a ServiceRequest model for all service types
* [x] Pre-define simple service requests to begin with
* [x] Django admin for admins to handle requests
* [x] Notifications for Matrix
* [x] Moved Service Access to `services` app
* [x] Auto-create default service requests for new memberships
* [x] Most simple kinds of tests added
* [x] Fix issue in generating service requests (check for service access firstly)
* [ ] Channel and bot account

## Deployment

1. Create a bot account. Get an access token with:

   ```
   curl -XPOST \
     -d '{"type":"m.login.password", "user":"<userid>", "password":"<password>"}' \
     "https://data.coop/_matrix/client/r0/login"
   ```

2. Create an admin room for admins. Add admins + bot. Copy the room ID.
3. Add new environment variables for the setup `MATRIX_ACCESS_TOKEN` and `MATRIX_SERVICE_REQUEST_ADMIN_ROOM`

Reviewed-on: https://git.data.coop/data.coop/membersystem/pulls/59
Co-authored-by: bbb <benjamin@overtag.dk>
Co-committed-by: bbb <benjamin@overtag.dk>
2025-01-15 07:16:12 +00:00

10 lines
300 B
Python

import pytest
from accounting import models
from django.contrib.auth.models import User
@pytest.mark.django_db()
def test_balance() -> None:
user = User.objects.create_user("test", "lala@adas.com", "1234")
account = models.Account.objects.create(owner=user)
assert account.balance == 0