<commit_before>from django.test import TestCase
from django_dynamic_fixture import G
from manager_utils import post_bulk_operation

from test_project.models import TestModel


class BulkUpsertTest(TestCase):
    """
    Tests the bulk_upsert function.
    """
    def test_wo_required_arguments(self):
        """
        Tests bulk_upsert with no arguments. A ValueError should be raised since it is required to provide a
        list of unique_fields.
        """
        with self.assertRaises(ValueError):
            TestModel.objects.bulk_upsert([], [], [])<commit_msg>100% test coverage<commit_after>from django.test import TestCase
from django_dynamic_fixture import G
from manager_utils import post_bulk_operation

from test_project.models import TestModel


class BulkUpsertTest(TestCase):
    """
    Tests the bulk_upsert function.
    """
    def test_wo_unique_fields(self):
        """
        Tests bulk_upsert with no unique fields. A ValueError should be raised since it is required to provide a
        list of unique_fields.
        """
        with self.assertRaises(ValueError):
            TestModel.objects.bulk_upsert([], [], ['field'])

    def test_wo_update_fields(self):
        """
        Tests bulk_upsert with no update fields. A ValueError should be raised since it is required to provide a
        list of update_fields.
        """
        with self.assertRaises(ValueError):
            TestModel.objects.bulk_upsert([], ['field'], [])
{'fraction_non_alphanumeric': 0.07880434782608696, 'fraction_numerical': 0.0020380434782608695, 'mean_word_length': 3.1145251396648046, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5888533', 'n_tokens_mistral': 401, 'n_tokens_neox': 400, 'n_words': 125}