Ferdinand Chan <unique...@gmail.com> writes: > Hi, > > I'm writing a unit test for a utility class that will make use of > information of a Model class. Here is the sample code for the model > class > > class Category extends LongKeyedMapper[Category] with IdPK{ > > def getSingleton = Category > > object parentCategoryId extends MappedLong(this) > > object name extends MappedPoliteString(this,255) { > override def validations = valMinLen(1, "Category cannot be > empty") _ :: super.validations > } > } > > In my scala test, I need to create a Category and then pass it to the > utility class. Then make sure the utility class is producing result as > expected. > > But the problem is that I can't set the ID of the Category , here is > my test code
val category = Category.create category.runSafe { category.id(1) } /Jeppe
-- You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.