<commit_before>from datetime import datetime

from django.test.testcases import TestCase

from django_evolution.models import Version


class VersionManagerTests(TestCase):
    """Unit tests for django_evolution.models.VersionManager."""

    def test_current_version_with_dup_timestamps(self):
        """Testing Version.current_version() with two entries with same timestamps"""
        timestamp = datetime(year=2015, month=12, day=10, hour=12, minute=13,
                             second=14)

        Version.objects.create(signature='abc123', when=timestamp)
        version = Version.objects.create(signature='abc123-def456',
                                         when=timestamp)

        latest_version = Version.objects.current_version()
        self.assertEqual(latest_version, version)<commit_msg>Fix unit tests for Version.objects.get_current().<commit_after>from datetime import datetime

from django.test.testcases import TestCase

from django_evolution.models import Version


class VersionManagerTests(TestCase):
    """Unit tests for django_evolution.models.VersionManager."""

    def test_current_version_with_dup_timestamps(self):
        """Testing Version.current_version() with two entries with same timestamps"""
        # Remove anything that may already exist.
        Version.objects.all().delete()

        timestamp = datetime(year=2015, month=12, day=10, hour=12, minute=13,
                             second=14)

        Version.objects.create(signature='abc123', when=timestamp)
        version = Version.objects.create(signature='abc123-def456',
                                         when=timestamp)

        latest_version = Version.objects.current_version()
        self.assertEqual(latest_version, version)
{'fraction_non_alphanumeric': 0.091324200913242, 'fraction_numerical': 0.026255707762557076, 'mean_word_length': 3.124705882352941, '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': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2882532', 'n_tokens_mistral': 463, 'n_tokens_neox': 420, 'n_words': 98}