<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
    <channel>
        <title>Javier Aguirre</title>
        <description>Software Libre and culture</description>
        <author>javaguirre</author>
        <link></link>
        
            <item>
                <title>Flashing Firefox OS in the Geeksphone Peak</title>
                <description>&lt;p&gt;The &lt;a href='https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Firefox_OS_build_prerequisites'&gt;official tutorial&lt;/a&gt; is excellent to do all the process smoothly, you will need to read it first. I wanted to share with you some problems I found building Firefox OS for the Geeksphone Peak. I am using ArchLinux, but some of the problems aren&amp;#8217;t OS related.&lt;/p&gt;

&lt;p&gt;After getting the &lt;em&gt;B2G&lt;/em&gt; code you will need to use the &lt;code&gt;./config.sh&lt;/code&gt; to build it for the Peak, It&amp;#8217;s not in the documentation but you actually can build the peak (the options are there for this device).&lt;/p&gt;

&lt;p&gt;To do it you will need its manifest, you can find it in.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;git clone git://github.com/mozilla-b2g/b2g-manifest.git&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;So when you want to build it for Peak without the manifest it will crash, but you can just get the &lt;code&gt;peak.xml&lt;/code&gt; from the previous repository.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;./config.sh peak route_for_b2g-manifest/peak.xml&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Following the official instructions and doing this for the Peak you will be able to config B2G for your device.&lt;/p&gt;

&lt;p&gt;When this is finished you will need to have your device connected to run&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;./build.sh&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Keep in mind you need to create the udev rule as It&amp;#8217;s documented in the Mozilla instructions.&lt;/p&gt;

&lt;p&gt;When the build is done you can flash it, so having the Android SDK correctly installed and in the &lt;code&gt;PATH&lt;/code&gt;, you can just.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;./flash.sh&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;If it doesn&amp;#8217;t work(it just freezes in &lt;strong&gt;waiting for device&lt;/strong&gt;) I realised I would need root permissions for one of the commands in the script, the one unlocking the Bootloader, &lt;code&gt;fastboot oem unlock&lt;/code&gt;, so If It doesn&amp;#8217;t work for you try with&amp;#8230;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;sudo ./flash.sh&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This didnt&amp;#8217;t work for me because the bootloader was still locked, so this was what I did to fix that.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;adb reboot bootloader
sudo fastboot oem unlock&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;In the chinese page you can push &lt;code&gt;Vol+&lt;/code&gt; to change the checkbox, once is changed you just push the &lt;code&gt;Power&lt;/code&gt; button. That&amp;#8217;s it! You have your phone unlocked! :-)&lt;/p&gt;

&lt;p&gt;Now we could flash the phone, the OS image has changed, so you need to activate the developer remote debugging again to use the flash script.&lt;/p&gt;

&lt;p&gt;Once you do that, you just&amp;#8230;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;./flash.sh # or sudo ./flash.sh&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;And that will be it! Have fun!&lt;/p&gt;

&lt;p&gt;Note: I couldn&amp;#8217;t record the errors I had in the process, sorry, but If you have any doubts don&amp;#8217;t hesitate to ask, I will try to answer when I have time.&lt;/p&gt;</description>
                <author>javaguirre</author>
                <published>2013-05-06 00:00:00 +0200</published>
                <link>http://javaguirre.net/2013/05/06/flashing-firefox-os-geeksphone-peak</link>
            </item>
        
            <item>
                <title>Geeksphone out of stock, again</title>
                <description>&lt;p&gt;It seems the geeksphone is out of stock again! Firefox OS is having the attention it deserves and I&amp;#8217;m happy for it.&lt;/p&gt;

&lt;p&gt;When I was waiting for the shop to open, I create a small script to know when was opened again, just for fun. If you are eager to get one like I was, maybe you would like to use it. :-)&lt;/p&gt;
&lt;pre&gt;&lt;code data-language='python'&gt;import requests
import time

WAIT = 600
r = requests.get('http://shop.geeksphone.com')
while True:
    if r.status_code == 200:
        print 'Geeksphone available'
    time.sleep(WAIT)

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You can change the print to send you an email for example.&lt;/p&gt;
&lt;pre&gt;&lt;code data-language='python'&gt;import requests
import time
import smtplib
from email.mime.text import MIMEText

WAIT = 600
r = requests.get('http://shop.geeksphone.com')
while True:
    if r.status_code == 200:
        server = 'mymachine@localhost'
        client = 'youremail@whatever.com'
        msg = MIMEText('Geeksphone available!')
        msg['Subject'] = 'Important message'
        msg['From'] = server
        msg['To'] = client
        s = smtplib.SMTP('localhost')
        s.sendmail(server, [client], msg.as_string())
        s.quit()
        break
    time.sleep(WAIT)

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If you want to send an email to yourself, install an application like Postfix or Exim for Python to be able to send it.&lt;/p&gt;</description>
                <author>javaguirre</author>
                <published>2013-05-03 00:00:00 +0200</published>
                <link>http://javaguirre.net/2013/05/03/geeksphone-shop-out-of-stock</link>
            </item>
        
            <item>
                <title>Continuous Integration, important and fun</title>
                <description>&lt;p&gt;Three months ago I installed a server in my place, a month ago I installed my own continuous integration service with &lt;a href='http://jenkins-ci.org/'&gt;Jenkins&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;It&amp;#8217;s the first time I&amp;#8217;m using my own CI service and I couldn&amp;#8217;t be happier, I&amp;#8217;m saving time and money with this service even when I&amp;#8217;m just alone in some of the projects. It helps me being much more careful with my projects and to keep a log of the projects status. I have it here listening in localhost, so It doesn&amp;#8217;t have connection to the outside, when I want to see it from the outside I just create a ssh tunnel for that moment.&lt;/p&gt;

&lt;p&gt;I have always been very interested in improving my development skills, usually learning new technologies, but I&amp;#8217;ve been thinking how to save time and control it this last months and I&amp;#8217;m very happy about it. Productivity is always an important matter for a freelance and a difficult one to measure if you don&amp;#8217;t have certain discipline. That&amp;#8217;s why I&amp;#8217;m using &lt;a href='https://github.com/vim-scripts/vimwiki'&gt;Vimwiki&lt;/a&gt; and &lt;em&gt;gtimelog&lt;/em&gt; every day to control it and create reports of the hours I&amp;#8217;m working. My clients want to know too, so I could use the same tool for their reports.&lt;/p&gt;

&lt;p&gt;I love the command line and &lt;em&gt;gtimelog&lt;/em&gt; is GTK+, so I&amp;#8217;m using a &lt;a href='http://reinout.vanrees.org/weblog/2013/04/17/gtimelog-for-timelogging.html'&gt;tweaked version from Reinout Van Rees&lt;/a&gt; to achieve that.&lt;/p&gt;</description>
                <author>javaguirre</author>
                <published>2013-05-02 00:00:00 +0200</published>
                <link>http://javaguirre.net/2013/05/02/continuous-integration-important-fun</link>
            </item>
        
            <item>
                <title>Squid y túnel SSH para estar como en casa, Firefox mediante</title>
                <description>&lt;p&gt;Esta semana he puesto a funcionar un proxy vía un servidor en España, al principio fue una tarea ardua, porque no tenía ni idea de lo que necesitaba y no le estaba preguntando los términos correctos a Google, pero tras pelearme y poner en funcionamiento OpenVPN y algunas cosas más me di cuenta que tenía un problema de concepto y que lo que yo necesitaba para ver las motos y la F1 como si estuviera allí era otra cosa.&lt;/p&gt;

&lt;p&gt;En Holanda no tenemos televisión en la casa y para ver algo tienes que pagar, mi actual compañía de Internet me ofrecía un paquete por &lt;code&gt;38.50&lt;/code&gt;(IVA de aquí incluido) que es menos que lo que pagaba en Madrid sólo por internet, pero nuestra negativa a no tener televisión es más de convivencia y deshacernos de cosas innecesarias.&lt;/p&gt;

&lt;p&gt;Después de entender conceptos y saber lo que necesitaba, montar el proxy para que Firefox entrara con Ip española fue la mar de fácil, voy a comentar aquí lo que se necesita, aunque en muchos lugares podéis encontrar una solucion parecida, eso sí en inglés. El sistema que me sirve a mí es el siguiente:&lt;/p&gt;

&lt;p&gt;En el servidor instalar &lt;a href='http://www.squid-cache.org/'&gt;Squid&lt;/a&gt; &lt;code&gt;apt-get install squid&lt;/code&gt; o &lt;code&gt;pacman -S squid&lt;/code&gt;, el paquete puede llamarse también &lt;code&gt;squid3&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;La configuración de squid, como sabréis estará normalmente en &lt;code&gt;/etc/squid(3)&lt;/code&gt; y no habrá que tocarla mucho, son unas 5000 líneas, pero sin comentar yo tenía poquitas, lo ideal es tener la aplicación escuchando únicamente en localhost por seguridad, y que ssh se encargue de la conexión de los puertos entre el servidor y nuestra máquina local.&lt;/p&gt;

&lt;p&gt;Una vez instalado y comprobado que Squid funciona (viendo que el puerto está activo con &lt;code&gt;netstat&lt;/code&gt;, mirando con &lt;code&gt;ps ax&lt;/code&gt; si el proceso se ha lanzado y si no tenemos ningún firewall incordiando), hacemos el túnel ssh. Si lo pusimos en el puerto por defecto de Squid bastará usar un comando del tipo:&lt;/p&gt;
&lt;pre&gt;&lt;code data-language='bash'&gt;ssh -C2TNvg -L 3128:localhost:3128 usuario@servidor
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Si todo ha ido bien podemos probar el proxy con la siguiente orden.&lt;/p&gt;
&lt;pre&gt;&lt;code data-language='bash'&gt;curl --proxy 127.0.0.1:3128 http://javaguirre.net
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Si no hay ningún problema recibirás el html de la página principal de esta web.&lt;/p&gt;

&lt;p&gt;Una vez funcione la llamada curl podemos introducir los datos del proxy en la configuración de Firefox. Elegimos &lt;code&gt;Preferencias, Avanzado, Configuración en Conexión&lt;/code&gt; y dentro &lt;code&gt;Configuración Manual&lt;/code&gt; en Firefox, en el &lt;code&gt;SOCKS y en HTTP&lt;/code&gt; Host tenemos que meter &lt;code&gt;127.0.0.1&lt;/code&gt; y el puerto el &lt;code&gt;3128&lt;/code&gt;. También se puede poner las mismas opciones (Ip, puerto) en &lt;code&gt;SSL y FTP&lt;/code&gt; si queremos usar el proxy para esos servicios.&lt;/p&gt;

&lt;p&gt;Con esto ya tenemos el proxy funcionando y deberíamos poder acceder a las webs que queramos. :-P&lt;/p&gt;

&lt;p&gt;Referencias:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href='https://calomel.org/firefox_ssh_proxy.html'&gt;https://calomel.org/firefox_ssh_proxy.html&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description>
                <author>javaguirre</author>
                <published>2013-03-25 00:00:00 +0100</published>
                <link>http://javaguirre.net/2013/03/25/squid-y-tunel-ssh-para-estar-como-en-casa</link>
            </item>
        
            <item>
                <title>/dev/haag meeting and Gitlab</title>
                <description>&lt;p&gt;Last Friday I had the opportunity to go to my first &lt;a href='http://www.devhaag.nl/'&gt;/dev/haag meeting&lt;/a&gt;, It is a really serious and well organized event with well-prepared talks.&lt;/p&gt;

&lt;p&gt;The first one was about &lt;em&gt;Reverse Launching&lt;/em&gt; and Gitlab, &lt;a href='http://blog.gitlab.com/'&gt;Sytse Sijbrandij&lt;/a&gt; gave us an interesting talk about trying to get feedback even before starting to ship anything, just feeding discussion about a possible market and checking the interest of people in that project in case it would came to reality.&lt;/p&gt;

&lt;p&gt;The second one was about the beautiful &lt;a href='https://www.rijksmuseum.nl/'&gt;RijksMuseum new website&lt;/a&gt;, &lt;strong&gt;Elaine Oliver&lt;/strong&gt; gave us a talk about how important is to be &lt;em&gt;responsive&lt;/em&gt; nowadays and their approach to get it for this site.&lt;/p&gt;

&lt;p&gt;The last talk was about a topic I&amp;#8217;m concern about, &lt;a href='https://twitter.com/DrWhax'&gt;DrWhax&lt;/a&gt; tried to immerse us in the world of cryptography in Internet and told us about the &lt;a href='http://en.wikipedia.org/wiki/CryptoParty'&gt;Cryptoparties&lt;/a&gt; and a more securized world.&lt;/p&gt;

&lt;p&gt;It was interesting to talk about &lt;strong&gt;Gitlab&lt;/strong&gt; and its possibilities with &lt;strong&gt;Sytse&lt;/strong&gt;, I had a really good time there and I will repeat next time for sure.&lt;/p&gt;

&lt;p&gt;I also got some conclusions about what we are missing in &lt;em&gt;Wadobo&lt;/em&gt; without a real project of our own, I think we need to improve that, explore options and try to put more efforts in our projects and less in consulting.&lt;/p&gt;</description>
                <author>javaguirre</author>
                <published>2013-02-25 00:00:00 +0100</published>
                <link>http://javaguirre.net/2013/02/25/dev-haag-meeting-and-gitlab</link>
            </item>
        
            <item>
                <title>After FOSDEM 2013</title>
                <description>&lt;p&gt;This year has been my first time at &lt;em&gt;FOSDEM&lt;/em&gt;. I liked the experience but I think I could have enjoyed it more with a community behind, I think this kind of event has more meaning when you are part of a FLOSS community, otherwise you are not enjoying all that offers.&lt;/p&gt;

&lt;p&gt;In general the focus of the conferences has been mobile development(Firefox OS and others) and I missed more Hardware content, I am very interested in robotics and it would be good if talks about Open Hardware and 3d printers could have taken place, I understand that&amp;#8217;s not anybody&amp;#8217;s fault, but I wanted to point it out.&lt;/p&gt;

&lt;p&gt;FOSDEM has increased my interest in contributing in a big project, concretely &lt;strong&gt;Mozilla&lt;/strong&gt;, I think there are a lot of interesting stuff to do and learn there and it&amp;#8217;s a great place to improve skills as a developer.&lt;/p&gt;

&lt;p&gt;I&amp;#8217;m very interested in C++, It&amp;#8217;s a logical step for me, to start doing something with this language to be able to contribute in more different and meaningful projects.&lt;/p&gt;

&lt;p&gt;Good experience, I think we will repeat next year, hopefully. :-)&lt;/p&gt;

&lt;p&gt;If you want more, Danigm &lt;a href='http://danigm.net/fosdem13.html'&gt;has written much more and detailed than me in his blog(ES)&lt;/a&gt;.&lt;/p&gt;</description>
                <author>javaguirre</author>
                <published>2013-02-16 00:00:00 +0100</published>
                <link>http://javaguirre.net/2013/02/16/after-fosdem-2013</link>
            </item>
        
            <item>
                <title>Playing with Bootstrap tour, Anchors for navigation and onShown event</title>
                <description>&lt;p&gt;Today I have been finishing the integration of &lt;em&gt;Bootstrap tour&lt;/em&gt; in our &lt;em&gt;AngularJS&lt;/em&gt; application. I was having a problem with navigation with the path element in the steps because they does not support anchors for navigation, so I did a little &lt;a href='https://github.com/sorich87/bootstrap-tour/pull/42'&gt;pull request&lt;/a&gt; to fix that to my needs.&lt;/p&gt;

&lt;p&gt;The second problem I had was the position of popovers, I wanted to change it after it was shown and I didn&amp;#39;t found a good event to cover my needs in the documentation. Although checking the code I fond an &lt;code&gt;onShown&lt;/code&gt; event I&amp;#8217;m using to fix the position of some of the steps. The solution would be something like this.&lt;/p&gt;
&lt;pre&gt;&lt;code data-language='javascript'&gt;var tour = new Tour({
    onShown: function (tour) {
        if(tour._current === 0 || tour._current === null) {
            //do something for the first step
        }
        else if(tour._current == 4) {
            //do something for the fourth step
        }
    }
});
&lt;/code&gt;&lt;/pre&gt;</description>
                <author>javaguirre</author>
                <published>2013-02-04 00:00:00 +0100</published>
                <link>http://javaguirre.net/2013/02/04/bootstrap-tour-anchors-playing-events</link>
            </item>
        
            <item>
                <title>Checking Boostrap Tour</title>
                <description>&lt;p&gt;Today we have been started using &lt;a href='http://sorich87.github.com/bootstrap-tour'&gt;Bootstrap Tour&lt;/a&gt;, interesting stuff. It seems to be easy to create tours for your site with it, but I couldn&amp;#39;t get it working perfectly yet.&lt;/p&gt;

&lt;p&gt;It&amp;#8217;s developed with &lt;em&gt;Coffeescript&lt;/em&gt; and has some good events too.&lt;/p&gt;

&lt;p&gt;It uses &lt;em&gt;localStorage&lt;/em&gt; or &lt;em&gt;cookies&lt;/em&gt; to store the current step of the tour and can navigate through your site when you go further in it.&lt;/p&gt;

&lt;p&gt;I have some trouble with the integration with my &lt;em&gt;Angular app&lt;/em&gt;, something normal, and I have fixed &lt;a href='https://github.com/sorich87/bootstrap-tour/pull/41'&gt;a little bug too&lt;/a&gt;, we had time for everything. :-)&lt;/p&gt;

&lt;p&gt;There are some things to finish in our integration, I hope we could contribute more in the project.&lt;/p&gt;</description>
                <author>javaguirre</author>
                <published>2013-01-31 00:00:00 +0100</published>
                <link>http://javaguirre.net/2013/01/31/checking-bootstrap-tour</link>
            </item>
        
            <item>
                <title>Avoiding nodes overlapping in d3 trees</title>
                <description>&lt;p&gt;This is a simple example to avoid overlapping between siblings in a &lt;a href='http://mbostock.github.com/d3/talk/20111018/tree.html'&gt;d3 tree&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I have been working a lot with d3 trees lately and dynamic node resizing, which is cool to have a complex representation for you data.&lt;/p&gt;

&lt;p&gt;When using simple d3 trees with different node sizes, they sometimes overlap with each other. I knew there is a &lt;em&gt;separation method&lt;/em&gt;, but I couldn&amp;#8217;t get it working for my case, so using an &lt;a href='http://mbostock.github.com/d3/talk/20110921/collision.html'&gt;example designed for d3 force element&lt;/a&gt; I could adapt to my current simple tree.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;function collide(node, node_sibling) {
  var r = node.size,
      n1y1 = node.x - r,
      n1y2 = node.x + r;
  var r2 = node_sibling.size,
      n2y1 = node_sibling.x - r2,
      n2y2 = node_sibling.x + r2;
  result = (n1y1 &amp;lt; n2y2 &amp;amp;&amp;amp; n1y1 &amp;gt; n2y1) || (n1y2 &amp;gt; n2y2 &amp;amp;&amp;amp; n1y2 &amp;lt; n2y1);

  return result;
}&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The size property doesn&amp;#8217;t exist in nodes, so it will be whatever property you want to control the size of them.&lt;/p&gt;

&lt;p&gt;I&amp;#8217;m just checking in one dimension (&lt;code&gt;x&lt;/code&gt;) because I want to control only siblings in my tree and they are aligned across the &lt;code&gt;y&lt;/code&gt; axis. You could do the same with the &lt;code&gt;y&lt;/code&gt; property in this function.&lt;/p&gt;

&lt;p&gt;This kind of function could be approximately the same for other d3 elements.&lt;/p&gt;

&lt;p&gt;To use it in a tree we could use it inside a &lt;code&gt;forEach loop&lt;/code&gt; in nodes.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;function detectCollisions(nodes) {
  nodes.forEach(function(d, index) {
    for (var i=0; i &amp;lt; siblings.length; i++)
    {
        if(d.id != siblings[i].id) {
            if(collide(d, sibligns[i])) {
                // Do something, like change the position
                // of the current sibling
            }
        }
    }
  });
}&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This is it by now, I will get more deeply into it soon if I think there is something worth to comment.&lt;/p&gt;</description>
                <author>javaguirre</author>
                <published>2013-01-30 00:00:00 +0100</published>
                <link>http://javaguirre.net/2013/01/30/fixing-nodes-overlapping-d3-tree</link>
            </item>
        
            <item>
                <title>Using SessionAuthentication With Tastypie tests for Django</title>
                <description>&lt;p&gt;Today I have been studying more deeply how to create good &lt;a href='http://django-tastypie.readthedocs.org/en/latest/testing.html'&gt;tests with Tastypie&amp;#8217;s alpha version documentation&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;It was easy to start if you knew about &lt;a href='http://docs.python.org/2/library/unittest.html#unittest.TestCase'&gt;TestCase&lt;/a&gt; and django test &lt;a href='https://docs.djangoproject.com/en/1.2/topics/testing/#default-test-client'&gt;Client&lt;/a&gt;, but still Tastypie documentation has a lot of blanks in this part.&lt;/p&gt;

&lt;p&gt;I was using &lt;a href='http://django-tastypie.readthedocs.org/en/latest/authentication_authorization.html#sessionauthentication'&gt;SessionAuthentication&lt;/a&gt; to authenticate my resources and it uses Django sessions in background, so it had to be easy to test it with the &lt;em&gt;ResourceTestCase&lt;/em&gt;. It wasn&amp;#8217;t as easy as it seemed and we needed to check the code to understand how to do it.&lt;/p&gt;

&lt;p&gt;In a real Django app we could use login method from &lt;code&gt;django.test.client.Client&lt;/code&gt;, and I thought &lt;code&gt;tastypie.test.TestApiClient&lt;/code&gt; could be inheriting from it, but because you can have different kinds of authentication it wasn&amp;#8217;t the right choice for the Tastypie api test client architecture.&lt;/p&gt;

&lt;p&gt;If we read TestApiClient&amp;#8217;s &lt;code&gt;__init__&lt;/code&gt; we can see it has a client attribute, instantiating from &lt;code&gt;django.client.Client&lt;/code&gt;.&lt;/p&gt;
&lt;pre&gt;&lt;code data-language='python'&gt;class TestApiClient(object):
    def __init__(self, serializer=None):
        &quot;&quot;&quot;
        Sets up a fresh ``TestApiClient`` instance.

        If you are employing a custom serializer, you can pass the class to the
        ``serializer=`` kwarg.
        &quot;&quot;&quot;
        self.client = Client()
        self.serializer = serializer

        if not self.serializer:
            self.serializer = Serializer()
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;With this in mind and following the same idea we could just do this in our tests.&lt;/p&gt;
&lt;pre&gt;&lt;code data-language='python'&gt;from tastypie.test import ResourceTestCase, TestApiClient


class ExampleResourceTest(ResourceTestCase):
    def setUp(self):
        self.api_client = TestApiClient()
        self.get_credentials()
        self.example = {'title': 'My Data'}

    def get_credentials(self):
        result = self.api_client.client.login(username='myuser',
                                              password='secret')
        return result

    def test_post_project(self):
        self.assertHttpCreated(self.api_client.post('/api/v1/example/',
                                                    format='json',
                                                    data=self.example))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now we can build authenticated requests for tests using &lt;code&gt;SessionAuthentication&lt;/code&gt; in &lt;strong&gt;Tastypie&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Easy after all. :-)&lt;/p&gt;</description>
                <author>javaguirre</author>
                <published>2013-01-29 00:00:00 +0100</published>
                <link>http://javaguirre.net/2013/01/29/using-session-authentication-tastypie-tests</link>
            </item>
        
    </channel>
</rss>
