Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
submarcos committed Jun 20, 2024
1 parent dc26497 commit f620809
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
10 changes: 4 additions & 6 deletions project/geosource/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ def test_refresh_view_accepted(self):
self.assertEqual(response.status_code, status.HTTP_202_ACCEPTED)
self.source_geojson.refresh_from_db()
self.assertEqual(self.source_geojson.status, Source.Status.PENDING.value)
self.assertEqual(
self.source_geojson.report.status, SourceReporting.Status.PENDING.value
self.assertIsNone(
self.source_geojson.report.status
)

def test_refresh_view_accepted_with_existing_report(self):
Expand All @@ -129,10 +129,8 @@ def test_refresh_view_accepted_with_existing_report(self):
self.assertEqual(
source.status, Source.Status.PENDING.value, source.get_status_display()
)
self.assertEqual(
source.report.status,
SourceReporting.Status.PENDING.value,
source.report.get_status_display(),
self.assertIsNone(
source.report.status
)

@patch(
Expand Down
1 change: 0 additions & 1 deletion project/geosource/tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,6 @@ def test_reset_method(self):
errors=["error 1", "error 2", "error 3"],
)
report.reset()
self.assertEqual(report.status, SourceReporting.Status.PENDING.value)
self.assertEqual(report.message, "")
self.assertEqual(report.added_lines, 0)
self.assertEqual(report.modified_lines, 0)
Expand Down
1 change: 0 additions & 1 deletion project/geosource/tests/test_serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,4 +225,3 @@ def test_update_method_reset_status(self):
self.source.refresh_from_db()
self.report.refresh_from_db()
self.assertEqual(self.source.status, Source.Status.NEED_SYNC.value)
self.assertEqual(self.report.status, SourceReporting.Status.PENDING.value)

0 comments on commit f620809

Please sign in to comment.