Admin¶
LoginStatusAdmin ¶
Bases: ModelAdmin
Admin page for LoginStatus model
OrganisationAdmin ¶
Bases: ModelAdmin
Admin page for Organisation model
OrganisationInvitesAdmin ¶
Bases: ModelAdmin
Admin page for OrganisationInvites model
OrganisationRepresentativeAdmin ¶
Bases: OrganisationPersonnelBaseAdmin
Admin page for OrganisationRepresentative model
OrganisationUserAdmin ¶
Bases: OrganisationPersonnelBaseAdmin
Admin page for OrganisationUser model
RemindersAdmin ¶
Bases: ModelAdmin
Admin page for Reminders model
UserRoleTypeAdmin ¶
Bases: ModelAdmin
Admin page for UserRoleType model
UserTitleAdmin ¶
Bases: ModelAdmin
Admin page for UserTitle model
Factories¶
OrganisationInvitesFactory ¶
Bases: DjangoModelFactory
Factory class for Organisation Invites model.
loginStatusFactory ¶
Bases: DjangoModelFactory
Factory class for login status models.
organisationFactory ¶
Bases: DjangoModelFactory
Factory class for organisation model.
organisationRepresentativeFactory ¶
Bases: DjangoModelFactory
Factory class for organisation representative model.
organisationUserFactory ¶
Bases: DjangoModelFactory
Factory class for organisation user model.
userFactory ¶
Bases: DjangoModelFactory
Factory class for user models.
userLoginFactory ¶
Bases: DjangoModelFactory
User login facfory class.
userProfileFactory ¶
Bases: DjangoModelFactory
Factory class for user profile model.
userRoleTypeFactory ¶
Bases: DjangoModelFactory
Factory class for user role type models.
userTitleFactory ¶
Bases: DjangoModelFactory
Factory class for user title models.
Models¶
LoginStatus ¶
Bases: Model
User login status model.
Organisation ¶
Bases: Model
Organisation model.
OrganisationInvites ¶
Bases: Model
OrganisationInvites model to store all invites
OrganisationPersonnel ¶
Bases: Model
Organisation personnel abstract model.
OrganisationRepresentative ¶
OrganisationUser ¶
Reminders ¶
Bases: Model
Reminders model to store all reminders
UserLogin ¶
Bases: Model
User login model.
UserProfile ¶
Bases: Model
Extend User model with one-to-one mapping.
UserRoleType ¶
Bases: Model
User role type (Base users, admins ..etc.) model.
UserTitle ¶
Bases: Model
User title model.
create_user_profile ¶
When a user is created, also create a UserProfile
Source code in django_project/stakeholder/models.py
post_create_organisation_representative ¶
Handle OrganisationRepresentative creation by automatically add them to Organisation Manager group.
Source code in django_project/stakeholder/models.py
post_create_organisation_user ¶
Handle OrganisationUser creation by automatically add them to Organisation Member group.
Source code in django_project/stakeholder/models.py
post_delete_organisation_representative ¶
Handle OrganisationRepresentative deletion by removing them from Data contributor and Organisation Manager group, if they are no longer part of any organisation.
Source code in django_project/stakeholder/models.py
post_delete_organisation_user ¶
Handle OrganisationUser deletion by removing them from Data contributor and Organisation Member group, if they are no longer part of any organisation.
Source code in django_project/stakeholder/models.py
save_user_profile ¶
Save the UserProfile whenever a save event occurs
Source code in django_project/stakeholder/models.py
Test Case¶
LoginStatusTestCase ¶
Bases: TestCase
User login status test case.
test_create_login_status ¶
Test creating login status.
Source code in django_project/stakeholder/tests/test_stakeholder_models.py
test_delete_login_status ¶
test_update_login_status ¶
Test updating a login status.
Source code in django_project/stakeholder/tests/test_stakeholder_models.py
OrganisationInvitesModelTest ¶
Bases: TestCase
test_create_organisation_invite ¶
Test create organisation invite.
Source code in django_project/stakeholder/tests/test_stakeholder_models.py
test_delete_organisation_invite ¶
Test delete organisation invite.
Source code in django_project/stakeholder/tests/test_stakeholder_models.py
test_read_organisation_invite ¶
Test read organisation invite.
Source code in django_project/stakeholder/tests/test_stakeholder_models.py
test_update_organisation_invite ¶
Test update organisation invite.
Source code in django_project/stakeholder/tests/test_stakeholder_models.py
OrganizationRepresentativeTestCase ¶
Bases: TestCase
Test case for organization representative.
setUpTestData
classmethod
¶
Setup test data for organisation representative model.
test_create_organisation_user ¶
Test creating organisation representative.
Source code in django_project/stakeholder/tests/test_stakeholder_models.py
test_delete_organisation_user ¶
Test deleting organisation representative.
test_update_organisation_user ¶
Test updating organisation representative.
Source code in django_project/stakeholder/tests/test_stakeholder_models.py
test_upgrade_to_manager ¶
Test upgrade a member to manager.
Source code in django_project/stakeholder/tests/test_stakeholder_models.py
488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 |
|
OrganizationTestCase ¶
Bases: TestCase
Organization test case.
test_create_organization ¶
Test creating organization.
Source code in django_project/stakeholder/tests/test_stakeholder_models.py
test_delete_organization ¶
test_update_organization ¶
Test updating organization.
Source code in django_project/stakeholder/tests/test_stakeholder_models.py
OrganizationUserTestCase ¶
Bases: TestCase
Test case for organization user.
setUpTestData
classmethod
¶
Setup test data for organisation user model.
Source code in django_project/stakeholder/tests/test_stakeholder_models.py
test_create_organisation_user_default ¶
Test creating organisation user, defaulted to Organisation Member.
Source code in django_project/stakeholder/tests/test_stakeholder_models.py
test_create_organisation_user_manager ¶
Test creating organisation user as manager.
Source code in django_project/stakeholder/tests/test_stakeholder_models.py
test_create_organisation_user_member ¶
Test creating organisation user as member.
Source code in django_project/stakeholder/tests/test_stakeholder_models.py
test_delete_organisation_user ¶
Test deleting organisation user.
Source code in django_project/stakeholder/tests/test_stakeholder_models.py
363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 |
|
test_update_organisation_user ¶
Test updating organisation user.
Source code in django_project/stakeholder/tests/test_stakeholder_models.py
TestUser ¶
Bases: TestCase
Test the main user model relation to the profie model.
test_create_new_user_with_new_profile ¶
test_delete_profile ¶
Test deleting user when a profile is deleted.
Source code in django_project/stakeholder/tests/test_stakeholder_models.py
test_update_user_profile ¶
Test updating user through profile.
Source code in django_project/stakeholder/tests/test_stakeholder_models.py
TestUserLogin ¶
TestUserRoleType ¶
TestProfileView ¶
Bases: TestCase
Tests CURD on Profile Model and test update profile view.
test_404 ¶
Test 404 mismatch user
Source code in django_project/stakeholder/tests/test_profile.py
test_post_with_data ¶
Test update profile from the form page
Source code in django_project/stakeholder/tests/test_profile.py
test_profile_create ¶
Tests profile creation
Source code in django_project/stakeholder/tests/test_profile.py
test_profile_delete ¶
test_profile_update ¶
Tests profile update
Source code in django_project/stakeholder/tests/test_profile.py
TestUpdatePropertyShortCode ¶
Bases: TestCase
Update Property Short Code test case.
test_update_short_code_from_organisation ¶
Test updating property short code when organization is updated.
Source code in django_project/stakeholder/tests/test_tasks.py
test_update_short_code_from_province ¶
Test updating property and organisaition short code when provincr is updated.
Source code in django_project/stakeholder/tests/test_tasks.py
Tasks¶
send_reminder_emails ¶
check any reminders that need to be sent, update reminder status and user notifications
Source code in django_project/stakeholder/tasks.py
Utils¶
add_user_to_org_manager ¶
Add user to Organisation Manager group.
Source code in django_project/stakeholder/utils.py
add_user_to_org_member ¶
Add user to Organisation Member group.
Source code in django_project/stakeholder/utils.py
remove_user_from_org_manager ¶
Remove user from Organisation Manager group.
Source code in django_project/stakeholder/utils.py
remove_user_from_org_member ¶
Remove user from Organisation Member group.
Source code in django_project/stakeholder/utils.py
Views¶
OrganisationAPIView ¶
Bases: APIView
Get organisation