From f88a396bfba1577c53eb05d9514d819099f5fe7e Mon Sep 17 00:00:00 2001 From: KlemenSpruk Date: Fri, 6 Oct 2023 14:30:33 +0200 Subject: [PATCH 1/2] addes todos --- vue/components/profile-search.vue | 2 ++ vue/profile-search-add-user.ts | 1 + 2 files changed, 3 insertions(+) diff --git a/vue/components/profile-search.vue b/vue/components/profile-search.vue index 15a45332..d7ff627f 100644 --- a/vue/components/profile-search.vue +++ b/vue/components/profile-search.vue @@ -17,6 +17,8 @@ const inputProps = defineProps<{ const emit = defineEmits(['selected']); +// todo: https://taiga.velis.si/project/velis74-dynamic-forms/us/836?no-milestone=1 + const searchUrl: string = (inputProps.searchUrl !== undefined ? inputProps.searchUrl : '/account/profile') as string; const selected: Ref = ref(null); diff --git a/vue/profile-search-add-user.ts b/vue/profile-search-add-user.ts index e1f88dca..1c732f9b 100644 --- a/vue/profile-search-add-user.ts +++ b/vue/profile-search-add-user.ts @@ -6,6 +6,7 @@ import { UserDataJSON } from './components/user-session/data-types'; let selectedUser: UserDataJSON | undefined; +// todo: https://taiga.velis.si/project/velis74-dynamic-forms/us/836?no-milestone=1 function selected(profile: UserDataJSON) { selectedUser = profile; } From 9fd9e8b732ace1308dd241b0958cf1900beb4216 Mon Sep 17 00:00:00 2001 From: KlemenSpruk Date: Mon, 16 Oct 2023 14:15:25 +0200 Subject: [PATCH 2/2] test for remaining license --- .../tests/api/test_remainig_license.py | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 django_project_base/notifications/tests/api/test_remainig_license.py diff --git a/django_project_base/notifications/tests/api/test_remainig_license.py b/django_project_base/notifications/tests/api/test_remainig_license.py new file mode 100644 index 00000000..d9ba9120 --- /dev/null +++ b/django_project_base/notifications/tests/api/test_remainig_license.py @@ -0,0 +1,21 @@ +from django.contrib.contenttypes.models import ContentType + +from django_project_base.licensing.logic import LogAccessService, MONTHLY_ACCESS_LIMIT_IN_CURRENCY_UNITS +from django_project_base.licensing.models import LicenseAccessUse +from django_project_base.notifications.tests.notifications_transaction_test_case import NotificationsTransactionTestCase + + +class TestRemainingLicense(NotificationsTransactionTestCase): + def test_remaining_license(self): + used_amount = 10 + mail = self.create_notification_email_object().send() + LicenseAccessUse.objects.create( + type=LicenseAccessUse.UseType.USE, + user_id=str(self.test_user.pk), + content_type_object_id=str(mail.pk), + content_type=ContentType.objects.get_for_model(mail._meta.model), + amount=used_amount, + comment=dict(comment="", count=10, item_price=1, sender=""), + ) + usage = LogAccessService().report(user=self.test_user) + self.assertEqual(MONTHLY_ACCESS_LIMIT_IN_CURRENCY_UNITS - used_amount, usage["remaining_credit"])