<commit_before>
from django.core.files import File
from django.utils import unittest
from spotseeker_server.models import *
from os.path import abspath, dirname

TEST_ROOT = abspath(dirname(__file__))

class SpotModelToStringTests(unittest.TestCase):
    def test_spot(self):
        spot = Spot.objects.create(name="This is the test name")

        test_str = "{0}".format(spot)
        self.assertEquals(test_str, "This is the test name", "Proper stringification of Spot objects")

    def test_available_hours(self):
        spot = Spot.objects.create(name="This is the test name")
        hours = SpotAvailableHours.objects.create(spot = spot, day = "m", start_time="11:00", end_time="14:00")

        test_str = "{0}".format(hours)
        self.assertEquals(test_str, "m: 11:00:00-14:00:00", "Proper stringification of SpotAvailableHours objects")

    def test_extended_info(self):
        spot = Spot.objects.create(name="This is the test name")
        attr = SpotExtendedInfo(key = "has_whiteboards", value = "1", spot = spot)

        test_str = "{0}".format(attr)
        self.assertEquals(test_str, "This is the test name[has_whiteboards: 1]", "Proper stringification of SpotExtendedInfo objects")

    def test_image(self):
        spot = Spot.objects.create(name="This is the test name")
        f = open("%s/resources/test_gif.gif" % TEST_ROOT)
        gif = SpotImage.objects.create( description = "This is the GIF test", spot=spot, image = File(f) )

        test_str = "{0}".format(gif)
        self.assertEquals(test_str, "This is the GIF test", "Proper stringification of SpotImage objects")<commit_msg>I should fix the unit test when I change something it's testing!<commit_after>
from django.core.files import File
from django.utils import unittest
from spotseeker_server.models import *
from os.path import abspath, dirname

TEST_ROOT = abspath(dirname(__file__))

class SpotModelToStringTests(unittest.TestCase):
    def test_spot(self):
        spot = Spot.objects.create(name="This is the test name")

        test_str = "{0}".format(spot)
        self.assertEquals(test_str, "This is the test name", "Proper stringification of Spot objects")

    def test_available_hours(self):
        spot = Spot.objects.create(name="This is the test name")
        hours = SpotAvailableHours.objects.create(spot = spot, day = "m", start_time="11:00", end_time="14:00")

        test_str = "{0}".format(hours)
        self.assertEquals(test_str, "This is the test name: m, 11:00:00-14:00:00", "Proper stringification of SpotAvailableHours objects")

    def test_extended_info(self):
        spot = Spot.objects.create(name="This is the test name")
        attr = SpotExtendedInfo(key = "has_whiteboards", value = "1", spot = spot)

        test_str = "{0}".format(attr)
        self.assertEquals(test_str, "This is the test name[has_whiteboards: 1]", "Proper stringification of SpotExtendedInfo objects")

    def test_image(self):
        spot = Spot.objects.create(name="This is the test name")
        f = open("%s/resources/test_gif.gif" % TEST_ROOT)
        gif = SpotImage.objects.create( description = "This is the GIF test", spot=spot, image = File(f) )

        test_str = "{0}".format(gif)
        self.assertEquals(test_str, "This is the GIF test", "Proper stringification of SpotImage objects")
{'fraction_non_alphanumeric': 0.11897590361445783, 'fraction_numerical': 0.01566265060240964, 'mean_word_length': 3.8200290275761972, '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': '4902203', 'n_tokens_mistral': 1043, 'n_tokens_neox': 991, 'n_words': 277}