from __future__ import unicode_literals

import factory
from . import models


class LibraryFactory(factory.DjangoModelFactory):
    FACTORY_FOR = models.Library
    name = 'mylib'


class LibraryVersionFactory(factory.DjangoModelFactory):
    FACTORY_FOR = models.LibraryVersion
    library = factory.SubFactory(LibraryFactory)
    version = '0.1.0-alpha'

@@ -49,16 +49,17 @@
 factory%0A
+%0A
 from . i
@@ -73,16 +73,163 @@
 odels%0A%0A%0A
+class LanguageFactory(factory.DjangoModelFactory):%0A    FACTORY_FOR = models.Language%0A    name = factory.Sequence(lambda n: 'lang %7B0%7D'.format(n))%0A%0A%0A
 class Li
@@ -303,16 +303,67 @@
 Library%0A
+    language = factory.SubFactory(LanguageFactory)%0A
     name

Fix factories and, thus, failing tests