<commit_before>from django.test import TestCase
from django.db import models
from tagging.fields import TagField

class Post(models.Model):
    tags = TagField()

class Link(models.Model):
    tags = TagField()

class TagCloudTests(TestCase):
    def testCreatePost(self):
        self.assertEqual(0, Post.objects.count())
        Post(tags = 'one, two, three').save()
        self.assertEqual(1, Post.objects.count())<commit_msg>Added unittest for getting models with tags.<commit_after>from django.test import TestCase
from django.db import models
from tagging.fields import TagField

class Post(models.Model):
    tags = TagField()

class Link(models.Model):
    tags = TagField()

class TagCloudTests(TestCase):
    def testCreatePost(self):
        self.assertEqual(0, Post.objects.count())
        Post(tags = 'one, two, three').save()
        self.assertEqual(1, Post.objects.count())

    def testContentTypes(self):
        from django_antichaos import get_tagged_models

        Post(tags = 'one, two, three').save()
        Link(tags = 'six, seven').save()

        mods = get_tagged_models()
        self.assertEqual(2, len(mods))
        self.assert_(Post in mods)
        self.assert_(Link in mods)

{'fraction_non_alphanumeric': 0.1170651277823578, 'fraction_numerical': 0.004122011541632316, 'mean_word_length': 3.446886446886447, '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': '6117957', 'n_tokens_mistral': 360, 'n_tokens_neox': 352, 'n_words': 92}