File tree 2 files changed +8
-2
lines changed
2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -208,7 +208,7 @@ - (NSManagedObjectID *)createOrUpdateAccountWithUsername:(NSString *)username au
208
208
[self .coreDataStack performAndSaveUsingBlock: ^(NSManagedObjectContext *context) {
209
209
WPAccount *account = [WPAccount lookupWithUsername: username context: context];
210
210
if (!account) {
211
- account = [NSEntityDescription insertNewObjectForEntityForName: @" Account" inManagedObjectContext: context];
211
+ account = [NSEntityDescription insertNewObjectForEntityForName: @" WordPressData. Account" inManagedObjectContext: context];
212
212
account.uuid = [[NSUUID new ] UUIDString ];
213
213
account.username = username;
214
214
}
Original file line number Diff line number Diff line change @@ -13,7 +13,13 @@ public extension NSManagedObject {
13
13
/// Note: entity().name returns nil as per iOS 10, in Unit Testing Targets. Awesome.
14
14
///
15
15
@objc class func entityName( ) -> String {
16
- return entity ( ) . name ?? classNameWithoutNamespaces ( )
16
+ // FIXME: First, let's see how this behaves in the tests..
17
+ guard NSClassFromString ( " XCTestCase " ) != nil else {
18
+ return entity ( ) . name ?? classNameWithoutNamespaces ( )
19
+ }
20
+
21
+ // No need to check entity().name because we know it's nil in the unit tests
22
+ return " WordPressData. \( classNameWithoutNamespaces ( ) ) "
17
23
}
18
24
19
25
/// Returns a NSFetchRequest instance with it's *Entity Name* always set.
You can’t perform that action at this time.
0 commit comments