@@ -349,6 +349,7 @@ def test_available_plans_for_basic_plan_non_trial(
349
349
expected_result .append (BASIC_PLAN )
350
350
expected_result += PR_AUTHOR_PAID_USER_PLAN_REPRESENTATIONS .values ()
351
351
expected_result += TEAM_PLAN_REPRESENTATIONS .values ()
352
+ expected_result = [result .convert_to_DTO () for result in expected_result ]
352
353
353
354
assert plan_service .available_plans (owner = self .owner ) == expected_result
354
355
@@ -365,6 +366,7 @@ def test_available_plans_for_free_plan_non_trial(
365
366
expected_result .append (FREE_PLAN )
366
367
expected_result += PR_AUTHOR_PAID_USER_PLAN_REPRESENTATIONS .values ()
367
368
expected_result += TEAM_PLAN_REPRESENTATIONS .values ()
369
+ expected_result = [result .convert_to_DTO () for result in expected_result ]
368
370
369
371
assert plan_service .available_plans (owner = self .owner ) == expected_result
370
372
@@ -380,6 +382,7 @@ def test_available_plans_for_team_plan_non_trial(
380
382
expected_result .append (BASIC_PLAN )
381
383
expected_result += PR_AUTHOR_PAID_USER_PLAN_REPRESENTATIONS .values ()
382
384
expected_result += TEAM_PLAN_REPRESENTATIONS .values ()
385
+ expected_result = [result .convert_to_DTO () for result in expected_result ]
383
386
384
387
assert plan_service .available_plans (owner = self .owner ) == expected_result
385
388
@@ -393,6 +396,7 @@ def test_available_plans_for_pro_plan_non_trial(self):
393
396
expected_result .append (BASIC_PLAN )
394
397
expected_result += PR_AUTHOR_PAID_USER_PLAN_REPRESENTATIONS .values ()
395
398
expected_result += TEAM_PLAN_REPRESENTATIONS .values ()
399
+ expected_result = [result .convert_to_DTO () for result in expected_result ]
396
400
397
401
assert plan_service .available_plans (owner = self .owner ) == expected_result
398
402
@@ -411,6 +415,7 @@ def test_available_plans_for_sentry_customer_basic_plan_non_trial(
411
415
expected_result += PR_AUTHOR_PAID_USER_PLAN_REPRESENTATIONS .values ()
412
416
expected_result += SENTRY_PAID_USER_PLAN_REPRESENTATIONS .values ()
413
417
expected_result += TEAM_PLAN_REPRESENTATIONS .values ()
418
+ expected_result = [result .convert_to_DTO () for result in expected_result ]
414
419
415
420
assert plan_service .available_plans (owner = self .owner ) == expected_result
416
421
@@ -429,6 +434,7 @@ def test_available_plans_for_sentry_customer_team_plan_non_trial(
429
434
expected_result += PR_AUTHOR_PAID_USER_PLAN_REPRESENTATIONS .values ()
430
435
expected_result += SENTRY_PAID_USER_PLAN_REPRESENTATIONS .values ()
431
436
expected_result += TEAM_PLAN_REPRESENTATIONS .values ()
437
+ expected_result = [result .convert_to_DTO () for result in expected_result ]
432
438
433
439
assert plan_service .available_plans (owner = self .owner ) == expected_result
434
440
@@ -445,6 +451,7 @@ def test_available_plans_for_sentry_plan_non_trial(self, is_sentry_user):
445
451
expected_result += PR_AUTHOR_PAID_USER_PLAN_REPRESENTATIONS .values ()
446
452
expected_result += SENTRY_PAID_USER_PLAN_REPRESENTATIONS .values ()
447
453
expected_result += TEAM_PLAN_REPRESENTATIONS .values ()
454
+ expected_result = [result .convert_to_DTO () for result in expected_result ]
448
455
449
456
assert plan_service .available_plans (owner = self .owner ) == expected_result
450
457
@@ -481,6 +488,7 @@ def test_available_plans_for_basic_plan_expired_trial_less_than_10_users(
481
488
expected_result .append (BASIC_PLAN )
482
489
expected_result += PR_AUTHOR_PAID_USER_PLAN_REPRESENTATIONS .values ()
483
490
expected_result += TEAM_PLAN_REPRESENTATIONS .values ()
491
+ expected_result = [result .convert_to_DTO () for result in expected_result ]
484
492
485
493
assert plan_service .available_plans (owner = self .owner ) == expected_result
486
494
@@ -496,6 +504,7 @@ def test_available_plans_for_team_plan_expired_trial_less_than_10_users(
496
504
expected_result .append (BASIC_PLAN )
497
505
expected_result += PR_AUTHOR_PAID_USER_PLAN_REPRESENTATIONS .values ()
498
506
expected_result += TEAM_PLAN_REPRESENTATIONS .values ()
507
+ expected_result = [result .convert_to_DTO () for result in expected_result ]
499
508
500
509
assert plan_service .available_plans (owner = self .owner ) == expected_result
501
510
@@ -509,6 +518,7 @@ def test_available_plans_for_pro_plan_expired_trial_less_than_10_users(self):
509
518
expected_result .append (BASIC_PLAN )
510
519
expected_result += PR_AUTHOR_PAID_USER_PLAN_REPRESENTATIONS .values ()
511
520
expected_result += TEAM_PLAN_REPRESENTATIONS .values ()
521
+ expected_result = [result .convert_to_DTO () for result in expected_result ]
512
522
513
523
assert plan_service .available_plans (owner = self .owner ) == expected_result
514
524
@@ -527,6 +537,7 @@ def test_available_plans_for_sentry_customer_basic_plan_expired_trial_less_than_
527
537
expected_result += PR_AUTHOR_PAID_USER_PLAN_REPRESENTATIONS .values ()
528
538
expected_result += SENTRY_PAID_USER_PLAN_REPRESENTATIONS .values ()
529
539
expected_result += TEAM_PLAN_REPRESENTATIONS .values ()
540
+ expected_result = [result .convert_to_DTO () for result in expected_result ]
530
541
531
542
assert plan_service .available_plans (owner = self .owner ) == expected_result
532
543
@@ -545,6 +556,7 @@ def test_available_plans_for_sentry_customer_team_plan_expired_trial_less_than_1
545
556
expected_result += PR_AUTHOR_PAID_USER_PLAN_REPRESENTATIONS .values ()
546
557
expected_result += SENTRY_PAID_USER_PLAN_REPRESENTATIONS .values ()
547
558
expected_result += TEAM_PLAN_REPRESENTATIONS .values ()
559
+ expected_result = [result .convert_to_DTO () for result in expected_result ]
548
560
549
561
assert plan_service .available_plans (owner = self .owner ) == expected_result
550
562
@@ -563,6 +575,7 @@ def test_available_plans_for_sentry_plan_expired_trial_less_than_10_users(
563
575
expected_result += PR_AUTHOR_PAID_USER_PLAN_REPRESENTATIONS .values ()
564
576
expected_result += SENTRY_PAID_USER_PLAN_REPRESENTATIONS .values ()
565
577
expected_result += TEAM_PLAN_REPRESENTATIONS .values ()
578
+ expected_result = [result .convert_to_DTO () for result in expected_result ]
566
579
567
580
assert plan_service .available_plans (owner = self .owner ) == expected_result
568
581
@@ -594,6 +607,7 @@ def test_available_plans_for_pro_plan_expired_trial_more_than_10_users(self):
594
607
expected_result = []
595
608
expected_result .append (BASIC_PLAN )
596
609
expected_result += PR_AUTHOR_PAID_USER_PLAN_REPRESENTATIONS .values ()
610
+ expected_result = [result .convert_to_DTO () for result in expected_result ]
597
611
598
612
assert plan_service .available_plans (owner = self .owner ) == expected_result
599
613
@@ -611,6 +625,7 @@ def test_available_plans_for_sentry_customer_basic_plan_expired_trial_more_than_
611
625
expected_result .append (BASIC_PLAN )
612
626
expected_result += PR_AUTHOR_PAID_USER_PLAN_REPRESENTATIONS .values ()
613
627
expected_result += SENTRY_PAID_USER_PLAN_REPRESENTATIONS .values ()
628
+ expected_result = [result .convert_to_DTO () for result in expected_result ]
614
629
615
630
assert plan_service .available_plans (owner = self .owner ) == expected_result
616
631
@@ -628,6 +643,7 @@ def test_available_plans_for_sentry_plan_expired_trial_more_than_10_users(
628
643
expected_result .append (BASIC_PLAN )
629
644
expected_result += PR_AUTHOR_PAID_USER_PLAN_REPRESENTATIONS .values ()
630
645
expected_result += SENTRY_PAID_USER_PLAN_REPRESENTATIONS .values ()
646
+ expected_result = [result .convert_to_DTO () for result in expected_result ]
631
647
632
648
assert plan_service .available_plans (owner = self .owner ) == expected_result
633
649
@@ -643,6 +659,9 @@ def setUp(self):
643
659
self .expected_result .append (BASIC_PLAN )
644
660
self .expected_result += PR_AUTHOR_PAID_USER_PLAN_REPRESENTATIONS .values ()
645
661
self .expected_result += TEAM_PLAN_REPRESENTATIONS .values ()
662
+ self .expected_result = [
663
+ result .convert_to_DTO () for result in self .expected_result
664
+ ]
646
665
647
666
def test_currently_team_plan (self ):
648
667
self .current_org = OwnerFactory (
@@ -700,6 +719,10 @@ def test_trial_not_started(self):
700
719
self .expected_result .append (BASIC_PLAN )
701
720
self .expected_result += PR_AUTHOR_PAID_USER_PLAN_REPRESENTATIONS .values ()
702
721
self .expected_result += TEAM_PLAN_REPRESENTATIONS .values ()
722
+ self .expected_result = [
723
+ result .convert_to_DTO () for result in self .expected_result
724
+ ]
725
+
703
726
assert (
704
727
self .plan_service .available_plans (owner = self .owner ) == self .expected_result
705
728
)
@@ -734,6 +757,7 @@ def test_non_sentry_user(self):
734
757
expected_result .append (BASIC_PLAN )
735
758
expected_result += PR_AUTHOR_PAID_USER_PLAN_REPRESENTATIONS .values ()
736
759
expected_result += TEAM_PLAN_REPRESENTATIONS .values ()
760
+ expected_result = [result .convert_to_DTO () for result in expected_result ]
737
761
738
762
# Can do Team plan when plan_activated_users is null
739
763
assert self .plan_service .available_plans (owner = self .owner ) == expected_result
@@ -751,6 +775,7 @@ def test_non_sentry_user(self):
751
775
expected_result = []
752
776
expected_result .append (BASIC_PLAN )
753
777
expected_result += PR_AUTHOR_PAID_USER_PLAN_REPRESENTATIONS .values ()
778
+ expected_result = [result .convert_to_DTO () for result in expected_result ]
754
779
755
780
# Can not do Team plan when at 11 activated users
756
781
assert self .plan_service .available_plans (owner = self .owner ) == expected_result
@@ -765,6 +790,7 @@ def test_sentry_user(self, is_sentry_user):
765
790
expected_result += PR_AUTHOR_PAID_USER_PLAN_REPRESENTATIONS .values ()
766
791
expected_result += SENTRY_PAID_USER_PLAN_REPRESENTATIONS .values ()
767
792
expected_result += TEAM_PLAN_REPRESENTATIONS .values ()
793
+ expected_result = [result .convert_to_DTO () for result in expected_result ]
768
794
769
795
# Can do Team plan when plan_activated_users is null
770
796
assert self .plan_service .available_plans (owner = self .owner ) == expected_result
@@ -783,6 +809,7 @@ def test_sentry_user(self, is_sentry_user):
783
809
expected_result .append (BASIC_PLAN )
784
810
expected_result += PR_AUTHOR_PAID_USER_PLAN_REPRESENTATIONS .values ()
785
811
expected_result += SENTRY_PAID_USER_PLAN_REPRESENTATIONS .values ()
812
+ expected_result = [result .convert_to_DTO () for result in expected_result ]
786
813
787
814
# Can not do Team plan when at 11 activated users
788
815
assert self .plan_service .available_plans (owner = self .owner ) == expected_result
0 commit comments