Skip to content
Snippets Groups Projects
Commit c69683dc authored by Stauros Kroustouris's avatar Stauros Kroustouris
Browse files

tests

parent c14c76e1
No related branches found
No related tags found
No related merge requests found
"""
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
from django.test import TestCase
from django.test import Client
Replace this with more appropriate tests for your application.
"""
from django.core.urlresolvers import reverse
from django.test import TestCase
class ApiTest(TestCase):
def setUp(self):
self.client = Client()
def test_api_urls(self):
'''
Check if api urls exist
'''
response = self.client.get(reverse('api:pops'))
self.assertEqual(response.status_code, 200)
def test_import_models(self):
'''
Check if needed models exist
'''
from network.models import PeerIfces, PeerSite
class SimpleTest(TestCase):
def test_basic_addition(self):
"""
Tests that 1 + 1 always equals 2.
"""
self.assertEqual(1 + 1, 2)
def test_static(self):
'''
Check if static files exist
'''
from django.contrib.staticfiles import finders
self.assertIsNot(finders.find('pops/icons/customer-legend.png'), None)
self.assertIsNot(finders.find('pops/icons/grnet-legend.png'), None)
self.assertIsNot(finders.find('pops/icons/commercial-legend.png'), None)
self.assertIsNot(finders.find('pops/icons/pin-legend.png'), None)
self.assertIsNot(finders.find('pops/icons/core-legend.png'), None)
self.assertIsNot(finders.find('pops/icons/access-optical-legend.png'), None)
self.assertIsNot(finders.find('pops/icons/access-l2-legend.png'), None)
self.assertIsNot(finders.find('pops/icons/distribution-legend.png'), None)
self.assertIsNot(finders.find('pops/icons/pass-through-thumb.png'), None)
self.assertIsNot(finders.find('pops/icons/unknown-thumb.png'), None)
self.assertIsNot(finders.find('bootstrap/js/bootstrap.js'), None)
self.assertIsNot(finders.find('pops/js/gmaps.js'), None)
self.assertIsNot(finders.find('pops/js/underscore-min.js'), None)
self.assertIsNot(finders.find('bootstrap/css/bootstrap.min.css'), None)
self.assertIsNot(finders.find('pops/css/maps.css'), None)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment