Bug 53718 - Test users/user property accountActicationDate combined with password reset
Test users/user property accountActicationDate combined with password reset
Status: RESOLVED FIXED
Product: UCS@school
Classification: Unclassified
Component: Ucsschool-lib
UCS@school 4.4
Other Linux
: P5 normal (vote)
: UCS@school 4.4 v9-errata
Assigned To: Arvid Requate
:
Depends on: 53675
Blocks:
  Show dependency treegraph
 
Reported: 2021-08-30 10:07 CEST by Arvid Requate
Modified: 2021-09-04 16:12 CEST (History)
3 users (show)

See Also:
What kind of report is it?: Development Internal
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Arvid Requate univentionstaff 2021-08-30 10:07:41 CEST
We should test the new users/user property accountActicationDate, introduced in UCS via Bug #53675, combined with password reset.
Comment 1 Arvid Requate univentionstaff 2021-08-30 10:22:21 CEST
a50bc5638 Bug #53675: Add accountActivationDate to user model
db6af5809 Bug #53675: Sort existing test cases
23d2e8fc2 Bug #53675: Add tests for accountActivationDate
9646c7091 Bug #53675: debian/changelog entries
3c4b8c707 Bug #53675: Merge branch 'arequate/bug53675-accountActivationDate'
935d0df7f Bug #53718: Advisory
20c34138d Bug #53718: Reduce test matrix to essential cases

Package: ucs-school-lib
Version: 12.2.34A~4.4.0.202108291957
Branch: ucs_4.4-0
Scope: ucs-school-4.4

Package: ucs-test-ucsschool
Version: 6.0.241A~4.4.0.202108301019
Branch: ucs_4.4-0
Scope: ucs-school-4.4
Comment 2 Ole Schwiegert univentionstaff 2021-08-30 22:17:26 CEST
I just build and installed the ucsschool.lib from my local git and got an ImportError. Do I see it correctly that this change requires a certain (not yet released) erratum for UCS 4.4-8?

If that is so, we have to make a new UCS@school release for this change!

Is this field actually desired/required in the UCS@school user model?
Comment 3 Daniel Tröder univentionstaff 2021-08-31 11:12:15 CEST
IMHO it's common practice to discuss API changes with the team maintaining a library. Proposed changes can be discussed and (p)reviewed in a git branch.

Please move the commits to a branch and revert them in main.
Then contact the UCS@school team to discuss the intended API change.
Comment 4 Arvid Requate univentionstaff 2021-09-01 00:09:01 CEST
> Is this field actually desired/required in the UCS@school user model?

I just need it for the test case. Tell me how to do this properly so I don't interfere.
Comment 5 Florian Best univentionstaff 2021-09-01 00:21:44 CEST
(In reply to Arvid Requate from comment #4)
> > Is this field actually desired/required in the UCS@school user model?
> 
> I just need it for the test case. Tell me how to do this properly so I don't
> interfere.

cat > foo.py <<EOF
from univention.admin.syntax import ActivationDateTimeTimezone

class AccountActivationDate(Attribute):
    udm_name = "accountActivationDate"
    syntax = ActivationDateTimeTimezone

import ucsschool.lib.models.user
ucsschool.lib.models.user.User.accountActivationDate = AccountActivationDate(_("ActivationDate"), aka=["ActivationDate", "Aktivierungsdatum"])
EOF

PYTHONSTARTUP=foo.py test.py
Comment 6 Arvid Requate univentionstaff 2021-09-01 00:25:10 CEST
That's what I did in a50bc5638, but that doesn't seem to be desired.
Comment 7 Florian Best univentionstaff 2021-09-01 00:26:35 CEST
(In reply to Arvid Requate from comment #6)
> That's what I did in a50bc5638, but that doesn't seem to be desired.

read carefully. My code doesn't change ucs-school-lib but only the test case code during the test run.
Comment 8 Florian Best univentionstaff 2021-09-02 11:48:40 CEST
I reverted your changes and cherry-picked them into git:requate/53718-account-activation-date

ucs-test-ucsschool (6.0.244)
23cfcfe5fdb5 | Revert Bug #53718 Bug #53675

ucs-school-lib (12.2.35)
23cfcfe5fdb5 | Revert Bug #53718 Bug #53675
Comment 9 Arvid Requate univentionstaff 2021-09-04 16:12:32 CEST
Test case implemented for https://git.knut.univention.de/univention/ucs/-/issues/651 to verify that udm users/user accountActivationDate doesn't break password reset by teacher/schooladmin.

Merge request: https://git.knut.univention.de/univention/ucsschool/-/merge_requests/63

Note: I could not follow the monkey patch idea, because I cannot monkey patch ucsschool.lib.models.user.User.do_create