<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.secondlife.com/w/index.php?action=history&amp;feed=atom&amp;title=User%3ABabbage_Linden%2FDjango%2FAutomated_Integration_Tests</id>
	<title>User:Babbage Linden/Django/Automated Integration Tests - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.secondlife.com/w/index.php?action=history&amp;feed=atom&amp;title=User%3ABabbage_Linden%2FDjango%2FAutomated_Integration_Tests"/>
	<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Babbage_Linden/Django/Automated_Integration_Tests&amp;action=history"/>
	<updated>2026-04-07T08:35:21Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.42.1</generator>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Babbage_Linden/Django/Automated_Integration_Tests&amp;diff=162653&amp;oldid=prev</id>
		<title>Babbage Linden: New page: Django has an [http://docs.djangoproject.com/en/dev/topics/testing/ automated integration test framework] that creates test databases, populates them with text fixtures, runs tests and cle...</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Babbage_Linden/Django/Automated_Integration_Tests&amp;diff=162653&amp;oldid=prev"/>
		<updated>2008-12-02T15:15:42Z</updated>

		<summary type="html">&lt;p&gt;New page: Django has an [http://docs.djangoproject.com/en/dev/topics/testing/ automated integration test framework] that creates test databases, populates them with text fixtures, runs tests and cle...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Django has an [http://docs.djangoproject.com/en/dev/topics/testing/ automated integration test framework] that creates test databases, populates them with text fixtures, runs tests and cleans up the test database. The test framework extends the python unit test frame providing a flexible test client that allows tests to be written like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import os&lt;br /&gt;
&lt;br /&gt;
from django.test import TestCase&lt;br /&gt;
&lt;br /&gt;
from indra.base import llsd&lt;br /&gt;
&lt;br /&gt;
def llsd_array_contains(array, substring):&lt;br /&gt;
    return [elem for elem in array if substring in elem]&lt;br /&gt;
&lt;br /&gt;
class RegionServicesReadTest(TestCase):&lt;br /&gt;
    fixtures = [os.path.dirname(__file__) + &amp;#039;/indra.json&amp;#039;]&lt;br /&gt;
&lt;br /&gt;
    def test001_get_null_region_id_returns_404(self):&lt;br /&gt;
        uri = &amp;#039;/region/42000000-0000-0000-0000-000000000042/&amp;#039;&lt;br /&gt;
        response = self.client.get(uri, {}, HTTP_ACCEPT=&amp;#039;application/llsd+xml&amp;#039;)&lt;br /&gt;
        self.failUnlessEqual(response.status_code, 404)&lt;br /&gt;
&lt;br /&gt;
    def test002_get_valid_region_id_returns_200(self):&lt;br /&gt;
        uri = &amp;#039;/region/78bc5b1a-f183-45c2-a6d0-2dcec6301e80/&amp;#039;&lt;br /&gt;
        response = self.client.get(uri, {}, HTTP_ACCEPT=&amp;#039;application/llsd+xml&amp;#039;)&lt;br /&gt;
        self.failUnlessEqual(response.status_code, 200)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And run like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ python manage.py test&lt;br /&gt;
Creating test database...&lt;br /&gt;
Creating table auth_permission&lt;br /&gt;
Creating table auth_group&lt;br /&gt;
Creating table auth_user&lt;br /&gt;
Creating table auth_message&lt;br /&gt;
Creating table django_content_type&lt;br /&gt;
Creating table django_session&lt;br /&gt;
Creating table django_site&lt;br /&gt;
Creating table django_admin_log&lt;br /&gt;
Creating table estate&lt;br /&gt;
Creating table presence_simulator&lt;br /&gt;
Creating table simulator&lt;br /&gt;
Installing index for auth.Permission model&lt;br /&gt;
Installing index for auth.Message model&lt;br /&gt;
Installing index for admin.LogEntry model&lt;br /&gt;
................................&lt;br /&gt;
----------------------------------------------------------------------&lt;br /&gt;
Ran 32 tests in 1.891s&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
Destroying test database...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Babbage Linden</name></author>
	</entry>
</feed>