from django.core.urlresolvers import reverse
from rest_framework.test import APITestCase
from rest_framework import status
import factory
import json
from .models import BaseAccount
from .serializers import WholeAccountSerializer


class UserFactory(factory.django.DjangoModelFactory):

    class Meta:
        model = BaseAccount

    first_name = 'John'
    last_name = 'Doe'
    email = '{}.{}@email.com'.format(first_name, last_name)
    password = 'passjohn1'


class FactoryBoyCreateUserTest(APITestCase):

    def setUp(self):
        self.user = UserFactory()

    def test_can_create_user(self):
        response = self.client.get(
            reverse('_accounts:account-detail', kwargs={'pk': 1}))
        self.assertEqual(response.status_code, status.HTTP_200_OK)
        self.assertJSONEqual(
            raw=json.dumps(response.data),
            expected_data=WholeAccountSerializer(self.user).data)

from django.core.urlresolvers import reverse
from rest_framework.test import APITestCase
from rest_framework import status
import factory
from .models import BaseAccount


class UserFactory(factory.Factory):

    class Meta:
        model = BaseAccount

    first_name = 'John'
    last_name = 'Doe'
    email = '{}.{}@email.com'.format(first_name, last_name)
    password = 'passjohn1'


class CreateUserTest(APITestCase):

    def setUp(self):
        self.user = UserFactory()
        self.client.login(email=self.user.email, password=self.user.password)

    def test_can_create_user(self):
        response = self.client.get(
                reverse('_accounts:account-list'),)
        self.assertEqual(response.status_code, status.HTTP_200_OK)

--- 
+++ 
@@ -2,10 +2,12 @@
 from rest_framework.test import APITestCase
 from rest_framework import status
 import factory
+import json
 from .models import BaseAccount
+from .serializers import WholeAccountSerializer
 
 
-class UserFactory(factory.Factory):
+class UserFactory(factory.django.DjangoModelFactory):
 
     class Meta:
         model = BaseAccount
@@ -16,13 +18,15 @@
     password = 'passjohn1'
 
 
-class CreateUserTest(APITestCase):
+class FactoryBoyCreateUserTest(APITestCase):
 
     def setUp(self):
         self.user = UserFactory()
-        self.client.login(email=self.user.email, password=self.user.password)
 
     def test_can_create_user(self):
         response = self.client.get(
-                reverse('_accounts:account-list'),)
+            reverse('_accounts:account-detail', kwargs={'pk': 1}))
         self.assertEqual(response.status_code, status.HTTP_200_OK)
+        self.assertJSONEqual(
+            raw=json.dumps(response.data),
+            expected_data=WholeAccountSerializer(self.user).data)
Create a test for user creation through `FactoryBoy`

Add a test for user creation
