Starting work on API test suite and removing reference to Site object.

master
Nick Sergeant 2013-03-24 17:21:04 -04:00
parent 8626b23ce7
commit 38c039a684
5 changed files with 4 additions and 62 deletions

View File

@ -1,16 +0,0 @@
"""
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
class SimpleTest(TestCase):
def test_basic_addition(self):
"""
Tests that 1 + 1 always equals 2.
"""
self.assertEqual(1 + 1, 2)

View File

@ -1,16 +0,0 @@
"""
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
class SimpleTest(TestCase):
def test_basic_addition(self):
"""
Tests that 1 + 1 always equals 2.
"""
self.assertEqual(1 + 1, 2)

View File

@ -1,4 +1,3 @@
from django.contrib.sites.models import Site
from django.contrib.auth.models import User
from django.conf import settings
from django.db import models
@ -16,8 +15,6 @@ from snipts.utils import slugify_uniquely
import datetime, md5, random, re
site = Site.objects.all()[0]
class Snipt(models.Model):
"""An individual Snipt."""
@ -165,7 +162,7 @@ class Snipt(models.Model):
else:
root = 'https://snipt.net'
return 'https://{}/embed/{}/'.format(site.domain, self.key)
return 'https://{}/embed/{}/'.format(root, self.key)
def get_raw_url(self):

View File

@ -1,16 +1,9 @@
"""
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
class SimpleTest(TestCase):
def test_basic_addition(self):
class SniptAPITest(TestCase):
def test_get_snipt(self):
"""
Tests that 1 + 1 always equals 2.
We should be able to get a public snipt from the API.
"""
self.assertEqual(1 + 1, 2)

View File

@ -1,16 +0,0 @@
"""
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
class SimpleTest(TestCase):
def test_basic_addition(self):
"""
Tests that 1 + 1 always equals 2.
"""
self.assertEqual(1 + 1, 2)