Starting work on API test suite and removing reference to Site object.
parent
8626b23ce7
commit
38c039a684
|
@ -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)
|
|
@ -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)
|
|
@ -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):
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
Loading…
Reference in New Issue