Skip to content

Instantly share code, notes, and snippets.

@bohde
Created January 2, 2013 16:21
Show Gist options
  • Save bohde/4435779 to your computer and use it in GitHub Desktop.
Save bohde/4435779 to your computer and use it in GitHub Desktop.
from django.test import TestCase
from models import App
from my_api import api
class ResourceUriTestCase(TestCase):
urls = 'path.to.api.urls'
def test_uri_uses_the_uuid(self):
uuid = new_uuid()
model = App(id=uuid)
resource = api.canonical_resource_for('app')
uri = resource.get_resource_uri(model)
self.assertEqual(uri, '/api/v1/app/%s/' % uuid)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment