Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: adding check to run migrations tests only if its django32. #33141

Merged
merged 1 commit into from
Aug 31, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion common/djangoapps/util/tests/test_db.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
"""Tests for util.db module."""

from importlib.metadata import version
from io import StringIO

import ddt

import pytest
from django.core.management import call_command
from django.db.transaction import TransactionManagementError, atomic
from django.test import TestCase, TransactionTestCase
from django.test.utils import override_settings

from common.djangoapps.util.db import enable_named_outer_atomic, generate_int_id, outer_atomic

GET_DJANGO_VERSION = int(version('django').split('.')[0])


def do_nothing():
"""Just return."""
Expand Down Expand Up @@ -116,6 +119,7 @@ def test_used_ids(self, times):
assert int_id in list(set(range(minimum, (maximum + 1))) - used_ids)


@pytest.mark.skipif(GET_DJANGO_VERSION > 3, reason="django4.2 brings new migrations, so only run for dj32 for now.")
class MigrationTests(TestCase):
"""
Tests for migrations.
Expand Down