|
8 | 8 | from services.comparison.types import Comparison, EnrichedPull, FullCommit
|
9 | 9 | from services.decoration import Decoration
|
10 | 10 | from services.notification.notifiers.comment import CommentNotifier
|
| 11 | +from tests.helpers import mock_all_plans_and_tiers |
11 | 12 |
|
12 | 13 |
|
13 | 14 | @pytest.fixture
|
@@ -335,6 +336,11 @@ def sample_comparison_for_limited_upload(
|
335 | 336 |
|
336 | 337 | @pytest.mark.usefixtures("is_not_first_pull")
|
337 | 338 | class TestCommentNotifierIntegration(object):
|
| 339 | + @pytest.fixture(autouse=True) |
| 340 | + def setup(self): |
| 341 | + mock_all_plans_and_tiers() |
| 342 | + |
| 343 | + @pytest.mark.django_db |
338 | 344 | def test_notify(self, sample_comparison, codecov_vcr, mock_configuration):
|
339 | 345 | sample_comparison.context = ComparisonContext(
|
340 | 346 | all_tests_passed=True, test_results_error=None
|
@@ -407,6 +413,7 @@ def test_notify(self, sample_comparison, codecov_vcr, mock_configuration):
|
407 | 413 | assert result.data_sent == {"commentid": None, "message": message, "pullid": 9}
|
408 | 414 | assert result.data_received == {"id": 1699669247}
|
409 | 415 |
|
| 416 | + @pytest.mark.django_db |
410 | 417 | def test_notify_test_results_error(
|
411 | 418 | self, sample_comparison, codecov_vcr, mock_configuration
|
412 | 419 | ):
|
@@ -482,6 +489,7 @@ def test_notify_test_results_error(
|
482 | 489 | assert result.data_sent == {"commentid": None, "message": message, "pullid": 9}
|
483 | 490 | assert result.data_received == {"id": 1699669247}
|
484 | 491 |
|
| 492 | + @pytest.mark.django_db |
485 | 493 | def test_notify_upgrade(
|
486 | 494 | self, dbsession, sample_comparison_for_upgrade, codecov_vcr, mock_configuration
|
487 | 495 | ):
|
@@ -516,6 +524,7 @@ def test_notify_upgrade(
|
516 | 524 | }
|
517 | 525 | assert result.data_received == {"id": 1361234119}
|
518 | 526 |
|
| 527 | + @pytest.mark.django_db |
519 | 528 | def test_notify_upload_limited(
|
520 | 529 | self,
|
521 | 530 | dbsession,
|
@@ -559,6 +568,7 @@ def test_notify_upload_limited(
|
559 | 568 | }
|
560 | 569 | assert result.data_received == {"id": 1111984446}
|
561 | 570 |
|
| 571 | + @pytest.mark.django_db |
562 | 572 | def test_notify_gitlab(
|
563 | 573 | self, sample_comparison_gitlab, codecov_vcr, mock_configuration
|
564 | 574 | ):
|
@@ -625,6 +635,7 @@ def test_notify_gitlab(
|
625 | 635 | assert result.data_sent == {"commentid": None, "message": message, "pullid": 5}
|
626 | 636 | assert result.data_received == {"id": 1457135397}
|
627 | 637 |
|
| 638 | + @pytest.mark.django_db |
628 | 639 | def test_notify_new_layout(
|
629 | 640 | self, sample_comparison, codecov_vcr, mock_configuration
|
630 | 641 | ):
|
@@ -695,6 +706,7 @@ def test_notify_new_layout(
|
695 | 706 | assert result.data_sent == {"commentid": None, "message": message, "pullid": 9}
|
696 | 707 | assert result.data_received == {"id": 1699669290}
|
697 | 708 |
|
| 709 | + @pytest.mark.django_db |
698 | 710 | def test_notify_with_components(
|
699 | 711 | self, sample_comparison, codecov_vcr, mock_configuration
|
700 | 712 | ):
|
|
0 commit comments