<commit_before>"""
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".

Replace this with more appropriate tests for your application.
"""

from django.test import TestCase

from . import views

class SimpleTest(TestCase):
    def test__frontend_html(self):
        html = views._frontend_html(base_url="BASE243", publish_url="PUB324",
                                    blank_url="BLANK591")
        self.assertTrue("PUB324" in html)
        self.assertTrue("BASE243" in html)
        self.assertTrue("BLANK591" in html)
        
    def test__sub_base_href(self):
        html = views._sub_base_href('\n  <base href="foibles.">\n\n', 'baseurl')
        self.assertEqual(html, '\n  <base href="baseurl">\n\n')<commit_msg>added tests for editor and blank page views.<commit_after>"""
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".

Replace this with more appropriate tests for your application.
"""

from django.test import TestCase
from nose.tools import eq_, ok_

from . import views

class SimpleTest(TestCase):
    def test_blank_page(self):
        response = self.client.get('/en-US/editor/blank')
        eq_(response.status_code, 200)
        ok_('x-frame-options' not in response) 
        
    def test_editor(self):
        response = self.client.get('/en-US/editor')
        eq_(response.status_code, 200)
        
    def test__frontend_html(self):
        html = views._frontend_html(base_url="BASE243", publish_url="PUB324",
                                    blank_url="BLANK591")
        self.assertTrue("PUB324" in html)
        self.assertTrue("BASE243" in html)
        self.assertTrue("BLANK591" in html)
        
    def test__sub_base_href(self):
        html = views._sub_base_href('\n  <base href="foibles.">\n\n', 'baseurl')
        self.assertEqual(html, '\n  <base href="baseurl">\n\n')
{'fraction_non_alphanumeric': 0.11346054667354306, 'fraction_numerical': 0.021660649819494584, 'mean_word_length': 2.903420523138833, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2825471', 'n_tokens_mistral': 604, 'n_tokens_neox': 574, 'n_words': 151}